external program crashes when run through subprocess.popen on XP

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Nov 18 21:40:22 CET 2008


En Tue, 18 Nov 2008 09:41:46 -0200, Christan K. <ckkart at hoc.net> escribió:
> ckkart <ckkart <at> gmail.com> writes:
>> on XP when starting a certain external program (plain C calculation
>> program which communicates via stdout/fs) from python 2.5 using
>> subprocess.Popen the external program crashes. It does not if started
>> directly from the XP command prompt. This is not a purely python
>> problems since the crash occurs as well if started e.g. from a msys
>> bash shell. The only things I find worth mentioning from the windows
>> debugging message is that FileVer and ProdVer of msvrct.dll differ, I
>> am no windows expert though.
>
> I just obseerved that the program does not crash if called via  
> subprocess.call
> so it seems to be related with having a way to communicate with the  
> external
> program or not.

Maybe the program attempts to write something to stdout/stderr? If you use  
Popen(..., stdout=None, stderr=None, ...) then the subprocess' standard  
handles will be invalid, and it will fail as soon as it attempts to write  
something.

-- 
Gabriel Genellina




More information about the Python-list mailing list