[issue6107] Subprocess.Popen output fails on Windows
report at bugs.python.org
Tue May 26 02:45:55 CEST 2009
New submission from Alex James <ac.james at shaw.ca>:
When calling p=subprocess.Popen(findstr "string" filename, stdout=PIPE)
both p.stdout.read() and p.communicate() are returning None even when
the shell process has output (ie string was found in filename).
Further, redirecting stdout to a file will write an empty file.
I've got this result from running in script and on IDLE command line
with Python 2.6.2 on windows Vista home premuim and windows XP SP2
Thinking this may be related to issue 1707753 or 1124861 I tried the
putting all streams to pipes workaround, but that also failed here.
Using subprocess.call with stdout to file did work.
This issue is primarily about the lack of cross-platform compatability
that the subprocess module was supposed to have, on unix systems the
base program I'm working with can call grep from any of os.popen,
popen2, or subprocess.Popen and work just fine.
title: Pipes fail to return subprocess output on Windows -> Subprocess.Popen output fails on Windows
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list