win32: popen works, popen3 causes hang

Alex Eggenberger eggy at island.net
Thu May 30 14:58:43 EDT 2002


I am trying to launch a program called leonardo spectrum from python
and retrieve the stdout and stderr that results.  spectrum.exe is
strictly command line under win32.  Here is what I have encountered:

launching spectrum.exe using the following call:
output = os.popen('spectrum.exe -file script.tcl')

The result is as expected, the program runs and I use output.read() to
get stdout.  I need some info from stderr.  So I would like to use
popen3 like this:
output = os.popen3('spectrum.exe -file script.tcl')

This causes spectrum.exe to hang.  I can tell it is hung on
spectrum.exe because I can see the process persists indefinitely in
Task Manager.

Is there a difference in the popen and popen3 operate that could be
causing this problem.  Everything else except the popen call is
identical in the two cases.

Any help or suggestions would be appreciated.

Alex



More information about the Python-list mailing list