Program stalls when called via Popen4?

Joshua Pollak joshp at cra.com
Fri Mar 21 10:37:13 EST 2003


Thanks! Thats probably the problem, I'll try it soon!

Ulrich Petri wrote:

>> > 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 fine.
>> >

>> 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)
>> while 1:
>>     if data == "":
>>         ret = compileProcess.poll()
>>         if ret != -1:
>>             break
>>     ret = compileProcess.read(1)
>>

-- 
Joshua Pollak             617-491-3474 x586
Software Engineer             joshp at cra.com
Charles River Analytics




More information about the Python-list mailing list