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

subprocess 'wait' method causes .py program to hang.

P: n/a
I calling a Windows executable with PROC = subprocess.Popen('...'), and
blocking further python execution until the process terminates with
PROC.wait(). Occasionally, something unusual happens with the
subprocess, and it fails without terminating the process. When this
happens, my Python program doesn't detect the error condition, and
hangs.

What can I do about this?

Earl Eiland

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sat, 19 Mar 2005 09:36:35 -0700, Earl Eiland <ee*@nmt.edu> declaimed
the following in comp.lang.python:

Isn't this the third time you've posted this question?
I calling a Windows executable with PROC = subprocess.Popen('...'), and
Forgive me, but is "subprocess.Popen()" something new in 2.4? I
can't find it in the modules available in 2.3.
blocking further python execution until the process terminates with
PROC.wait(). Occasionally, something unusual happens with the
By definition, don't the various "Popen" things imply at least
one pipe is created, for reading by default. But you seem not to have
any pipes in this call (or aren't using them, as it seems you are
getting back an object representing the entire subprocess state).
Perhaps the failure mode is not the termination of the subprocess, but a
state where it is waiting for a user response, which you do not provide.

Your wait() logic, with no access of pipe streams (visible)
seems similar to the use of

os.spawnl*()

followed by

os.waitpid()
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.