[issue12488] multiprocessing.Connection does not communicate pipe closure between parent and child

Luke report at bugs.python.org
Mon Jul 4 15:56:22 CEST 2011


Luke <lcampagn at email.unc.edu> added the comment:

That's interesting, thanks for your response.

It is also a bit awkward..
Might I recommend adding a note to the documentation? It is not really
intuitive that each child should need to close the end of the pipe it isn't
using (especially since it is possible to create a child that has no
explicit access to that end of the pipe, even though it has inherited the
file descriptor).

2011/7/4 Charles-François Natali <report at bugs.python.org>

>
> Charles-François Natali <neologix at free.fr> added the comment:
>
> That's because the other end of the pipe (p1) is open in the child process
> (FDs are inherited on fork()).
> Just add
> p1.close()
>
> at the beginning of fn() and you'll get EOF.
> Closing as invalid.
>
> ----------
> nosy: +neologix
> resolution:  -> invalid
> stage:  -> committed/rejected
> status: open -> closed
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue12488>
> _______________________________________
>

----------
Added file: http://bugs.python.org/file22569/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12488>
_______________________________________
-------------- next part --------------
That&#39;s interesting, thanks for your response.<div><br></div><div>It is also a bit awkward.. <div>Might I recommend adding a note to the documentation? It is not really intuitive that each child should need to close the end of the pipe it isn&#39;t using (especially since it is possible to create a child that has no explicit access to that end of the pipe, even though it has inherited the file descriptor). <br>

<div><br><br><div class="gmail_quote">2011/7/4 Charles-François Natali <span dir="ltr">&lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Charles-François Natali &lt;<a href="mailto:neologix at free.fr">neologix at free.fr</a>&gt; added the comment:<br>
<br>
That&#39;s because the other end of the pipe (p1) is open in the child process (FDs are inherited on fork()).<br>
Just add<br>
p1.close()<br>
<br>
at the beginning of fn() and you&#39;ll get EOF.<br>
Closing as invalid.<br>
<br>
----------<br>
nosy: +neologix<br>
resolution:  -&gt; invalid<br>
stage:  -&gt; committed/rejected<br>
status: open -&gt; closed<br>
<div><div></div><div class="h5"><br>
_______________________________________<br>
Python tracker &lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue12488" target="_blank">http://bugs.python.org/issue12488</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br></div></div></div>


More information about the Python-bugs-list mailing list