[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle <type 'thread.lock'>: it's not found as thread.lock

Nikita Pchelin report at bugs.python.org
Sat Dec 10 01:55:33 CET 2011


Nikita Pchelin <nikita.pchelin at gmail.com> added the comment:

>>Are you sure you don't store the logger in your process' __init__ 
method? The __init__ method is called in the parent and the process 
instance is transfered to the child when you call start() on the process.

To make sure we are on the same page, here is what I changed it to:
https://github.com/jango/PC/blob/test/pc/pc.py

-> lines 47-50 commented out (init of PC class that initialises threads);
-> lines 64, 65, 77, 78 getLogger within the PC class and print some 
messages;
-> lines 59, 61 71, 74 -- None is passed to the constructor of _Consumer 
and _Producer;
-> lines 135, 203 -- children user logger;

With this code, I still get the exception.

On 11-12-09 07:23 PM, Antoine Pitrou wrote:
> Antoine Pitrou<pitrou at free.fr>  added the comment:
>
>> If I getLogger() in the child instead, example fails with the same trace.
> That sounds rather unlikely. Are you sure you don't store the logger in your process' __init__ method? The __init__ method is called in the parent and the process instance is transfered to the child when you call start() on the process.
>
> ----------
>
> _______________________________________
> Python tracker<report at bugs.python.org>
> <http://bugs.python.org/issue13569>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13569>
_______________________________________


More information about the Python-bugs-list mailing list