polling for output from a subprocess module

Christian Heimes lists at cheimes.de
Mon Feb 4 15:53:21 CET 2008


Thomas Bellman wrote:
> The readlines() method will read until it reaches end of file (or
> an error occurs), not just what is available at the moment.  You
> can see that for your self by running:

Bad idea ;)

readlines() on a subprocess Popen instance will block when you PIPE more
than one stream and the buffer of the other stream is full.

You can find some insight at http://bugs.python.org/issue1606. I
discussed the matter with Guido a while ago.

Christian




More information about the Python-list mailing list