[Python-ideas] Tulip / PEP 3156 (original) (raw)
[Python-ideas] Tulip / PEP 3156 - subprocess events
Paul Moore p.f.moore at gmail.com
Fri Jan 18 23:57:45 CET 2013
- Previous message: [Python-ideas] Tulip / PEP 3156 - subprocess events
- Next message: [Python-ideas] Tulip / PEP 3156 - subprocess events
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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, errdatareceived() and erreofreceived(), which are to stderr what datareceived() and eofreceived() 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 connectionmade()/lost() methods. (However, we could argue endlessly over whether connectionlost() 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
- Previous message: [Python-ideas] Tulip / PEP 3156 - subprocess events
- Next message: [Python-ideas] Tulip / PEP 3156 - subprocess events
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]