This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author canhuth
Recipients canhuth
Date 2007-11-30.10:00:43
SpamBayes Score 0.010016473
Marked as misclassified No
Message-id <1196416844.07.0.705173497041.issue1525@psf.upfronthosting.co.za>
In-reply-to
Content
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
>>>
History
Date User Action Args
2007-11-30 10:00:44canhuthsetspambayes_score: 0.0100165 -> 0.010016473
recipients: + canhuth
2007-11-30 10:00:44canhuthsetspambayes_score: 0.0100165 -> 0.0100165
messageid: <1196416844.07.0.705173497041.issue1525@psf.upfronthosting.co.za>
2007-11-30 10:00:43canhuthlinkissue1525 messages
2007-11-30 10:00:43canhuthcreate