[issue4892] Sending Connection-objects over multiprocessing connections fails

sbt report at bugs.python.org
Sat Apr 7 17:52:06 CEST 2012


sbt <shibturn at gmail.com> added the comment:

Jimbofbx wrote:
> def main():
>     from multiprocessing import Pipe, reduction
>     i, o = Pipe()
>     print(i);
>     reduced = reduction.reduce_connection(i)
>     print(reduced);
>     newi = reduced[0](*reduced[1])
>     print(newi);
>     newi.send("hi")
>     o.recv()

On Windows with a PipeConnection object you should use rebuild_pipe_connection() instead of rebuild_connection().  With that change, on Python 3.3 I get

    <multiprocessing.connection.PipeConnection object at 0x025BBCB0>
    (<function rebuild_pipe_connection at 0x0262F420>, (('\\\\.\\pipe\\pyc-6000-1-30lq4p', 356, False), True, True))
    <multiprocessing.connection.PipeConnection object at 0x029FF710>

Having said all that I agree multiprocessing.reduction should be fixed.  Maybe an enable_pickling_support() function could be added to register the necessary things with copyreg.

----------

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


More information about the Python-bugs-list mailing list