Author tim.peters
Recipients TwistedSim, tim.peters
Date 2018-02-20.02:15:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519092910.1.0.467229070634.issue32879@psf.upfronthosting.co.za>
In-reply-to
Content
The docs could be clearer about this:  the argument to .put() is _not_ pickled at the time .put() is called.  The object is remembered (by reference, not by value), and a feeder thread pickles the value and puts the pickle on the queue when the feeder thread gets around to that.  So if the object is mutated in any way in between, it's not defined whether the pre- or post-mutation state is put on the queue (or, in some cases, even some partially mutated value).

To make it wholly deterministic you could, e.g., change the .put() to this:

        queue.put(data[:])

Or you could use a Manager().Queue() instead, which doesn't use a feeder thread.
History
Date User Action Args
2018-02-20 02:15:10tim.peterssetrecipients: + tim.peters, TwistedSim
2018-02-20 02:15:10tim.peterssetmessageid: <1519092910.1.0.467229070634.issue32879@psf.upfronthosting.co.za>
2018-02-20 02:15:10tim.peterslinkissue32879 messages
2018-02-20 02:15:09tim.peterscreate