New submission from canhuth:

Executing script using subprocess.Popen twice interactively fails
without error the second time. File a.py:

print "start"
import subprocess

print "first call"
process = subprocess.Popen(
        args   = "cmd.exe /c echo 1",
        stdout = subprocess.PIPE)

for line in process.stdout:
        if not line:
                break;
        print line;

print "second call"
process = subprocess.Popen(
        args   = "cmd.exe /c echo 2",
        stdout = subprocess.PIPE)

for line in process.stdout:
        if not line:
                break;
        print line;

print "end"

Executing it in Python on Windows, interactively:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import a
start
first call
1

second call
2

end
>>> import a
>>>

----------
components: Windows
messages: 57971
nosy: canhuth
severity: normal
status: open
title: Executing Python script using subprocess.Popen twice interactively fails 
without error the second time
type: behavior
versions: Python 2.5

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1525>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to