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

E

Earl Eiland

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
 
D

Dennis Lee Bieber

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()


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top