This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum, neologix
Date 2013-10-21.16:49:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382374181.16.0.240092919902.issue19326@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-10-21 16:49:41gvanrossumsetrecipients: + gvanrossum, neologix
2013-10-21 16:49:41gvanrossumsetmessageid: <1382374181.16.0.240092919902.issue19326@psf.upfronthosting.co.za>
2013-10-21 16:49:41gvanrossumlinkissue19326 messages
2013-10-21 16:49:41gvanrossumcreate