Guido van Rossum added the comment:

This is by design. Let me try to defend the design.

As long as one of the pipes is still open the parent might be interested in it. 
The Protocol object does get notified of the process's exit, via 
process_exited(), and if at that point it wants to be done, it can close the 
pipes itself. (To do that, call transport.get_pipe_transport(FD).close().) Once 
that's done the subprocess protocol's connection_lost() method will be called.

I suppose an alternative approach might be to assume that when the subprocess 
exist the parent should close the pipes and be done, but there's a race 
condition there: there may still be data in one of the pipes (stdout or stderr) 
that should be processed before calling connection_lost(), similar to how we 
delay the socket connection_lost() call until we have processed all data read 
from it.

So I don't think that alternative is viable.

----------

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

Reply via email to