[Python-ideas] Tulip / PEP 3156 - subprocess events

Paul Moore p.f.moore at gmail.com
Fri Jan 18 23:57:45 CET 2013


On 18 January 2013 22:15, Guido van Rossum <guido at python.org> wrote:
> But for this specific case there's a simpler solution -- require the
> protocol to support a few extra methods, in particular,
> err_data_received() and err_eof_received(), which are to stderr what
> data_received() and eof_received() are for stdout. (After all, the
> point of a subprocess is that "normal" data goes to stdout.) There's
> only one input stream to the subprocess, so there's no ambiguity for
> write(), and neither is there a need for multiple
> connection_made()/lost() methods. (However, we could argue endlessly
> over whether connection_lost() should be called when the subprocess
> exits, or when the other side of all three pipes is closed. :-)

While I don't really care about arguing over *when* connection_lost
should be called, it *is* relevant to my thinking that getting
notified when the process exits doesn't seem to me to be possible -
again it's the issue that the transport can't ask the event loop to
poll for anything that the event loop isn't already coded to check. So
(once again, unless I've missed something) the only viable option for
a standalone transport is to call connection_lost when all the pipes
are closed.

Am I still missing something?
Paul



More information about the Python-ideas mailing list