[New-bugs-announce] [issue1525] Executing Python script using subprocess.Popen twice interactively fails without error the second time

canhuth report at bugs.python.org
Fri Nov 30 11:00:44 CET 2007


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 <report at bugs.python.org>
<http://bugs.python.org/issue1525>
__________________________________


More information about the New-bugs-announce mailing list