[Pythonmac-SIG] Subprocess module hangs with select
sriram at malhar.net
Thu Aug 4 01:07:29 CEST 2005
I wonder if anyone has seen this behavior or can explain it to me.
I Popen a process and monitor its stdout using select, as follows.
process = Popen(args,stdin=PIPE, stdout=PIPE, stderr=PIPE)
if not (process.returncode == None):
ready,_, _ = select.select([process.stdout, process.stderr],
, , 5)
for fd in ready:
Now this works fine, in that it dumps out everything that the program
can print, but when the exec'd program finishes executing, the select
() call just hangs. The timeout on the select has no effect.
Thank you very much.
More information about the Pythonmac-SIG