Program stalls when called via Popen4?

Paul Boddie paul at
Fri Mar 21 18:21:25 CET 2003

Joshua Pollak <joshp at> wrote in message news:<Vrqea.6493$io.248058 at>...
> Everything seems to be working correctly, EXCEPT that the popen2.Popen4
> instance I'm using to actually build our project never returns. When I
> 'watch' what the subprocess is doing by using 'ps aux', it seems that it
> has stalled on the first call to 'echo'!

Quite often with popen2 functions, it can be advisable to close the
output stream to the child process. For example (with popen3, since I
don't know what popen4 returns):

  t = popen2.popen3(command)
  # Close output, which is the standard input of the command.
  # Read from t[0] and t[2].

That might prevent certain blocking conditions from occurring.


More information about the Python-list mailing list