Dialog with a process via subprocess.Popen blocks forever

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Mar 2 00:11:50 CET 2007

En Thu, 01 Mar 2007 14:42:00 -0300, <bayer.justin at googlemail.com> escribió:

> BUT If I use PIPE for both (so I can .write() on the stdin and .read()
> from the subprocess' stdout stream (better: file descriptor)) reading
> from the subprocess stdout blocks forever. If I write something onto
> the subprocess' stdin that causes it to somehow proceed, I can read
> from its stdout.

On http://docs.python.org/lib/popen2-flow-control.html there are some  
notes on possible flow control problems you may encounter.
If you have no control over the child process, it may be safer to use a  
different thread for reading its output.

Gabriel Genellina

More information about the Python-list mailing list