Luke <lcamp...@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 <rep...@bugs.python.org>
>
> Charles-François Natali <neolo...@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 <rep...@bugs.python.org>
> <http://bugs.python.org/issue12488>
> _______________________________________
>
----------
Added file: http://bugs.python.org/file22569/unnamed
_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12488>
_______________________________________
That'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'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"><<a
href="mailto:rep...@bugs.python.org">rep...@bugs.python.org</a>></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 <<a
href="mailto:neolo...@free.fr">neolo...@free.fr</a>> added the comment:<br>
<br>
That'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'll get EOF.<br>
Closing as invalid.<br>
<br>
----------<br>
nosy: +neologix<br>
resolution: Â -> invalid<br>
stage: Â -> committed/rejected<br>
status: open -> closed<br>
<div><div></div><div class="h5"><br>
_______________________________________<br>
Python tracker <<a
href="mailto:rep...@bugs.python.org">rep...@bugs.python.org</a>><br>
<<a href="http://bugs.python.org/issue12488"
target="_blank">http://bugs.python.org/issue12488</a>><br>
_______________________________________<br>
</div></div></blockquote></div><br></div></div></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com