By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,199 Members | 1,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,199 IT Pros & Developers. It's quick & easy.

external program crashes when run through subprocess.popen on XP

P: n/a
Hi,

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.

Any ideas?

Thanks, Christian

Nov 17 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 17 Nov, 19:15, ckkart <ckk...@gmail.comwrote:
Hi,

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.

Any ideas?
If it helps there is some finished code at

http://codewiki.wikispaces.com/tester.py

which used subprocess.Popen and works well under Windows and Linux.
Search for Popen to locate the specific call. Note that the code works
whether the shell argument is true or false.

James
Nov 17 '08 #2

P: n/a
ckkart <ckkart <atgmail.comwrites:
>
Hi,

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.

Christian

Nov 18 '08 #3

P: n/a
En Tue, 18 Nov 2008 09:41:46 -0200, Christan K. <ck****@hoc.netescribió:
ckkart <ckkart <atgmail.comwrites:
>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

Nov 18 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.