Tim Peters <t...@python.org> added the comment:

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.

----------
nosy: +tim.peters

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32879>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to