Program stalls when called via Popen4?
ulope at gmx.de
Fri Mar 21 00:08:58 CET 2003
"Joshua Pollak" <joshp at cra.com> schrieb im Newsbeitrag
news:Vrqea.6493$io.248058 at iad-read.news.verio.net...
> I'm writing an autobuild script for internal use at my company. Its
> to check our code out of our source control system, call our build system,
> then run our unit tests and email the results to a developer.
> 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'! I'm not sure how to debug this
> because when I try to duplicate the results manually, everything works
> Here is the relevant code:
> compileCommand = self.params["SetupCmd"] + " &&
> compileProcess = popen2.Popen4(compileCommand)
Do you read the output of compileProcess?
If not the buffer of the pipe will fill and then block the child.
You can use something like this:
data = compileProcess.fromchild.read(1)
if data == "":
ret = compileProcess.poll()
if ret != -1:
ret = compileProcess.read(1)
Of course you can increase the amount of data to be read at a time (e.g.
More information about the Python-list