[issue6107] Subprocess.Popen output fails on Windows

2009-05-26 Thread Alex James
Alex James added the comment: Um, nevermind. I completely missed cwd=os.path.split(sys.argv[0])[0] so the shell command wasn't operating in the same relative path as the script. And that never mattered on Unix because we always ran from commandline, not IDLE, so the shell inherited the comm

[issue6107] Subprocess.Popen output fails on Windows

2009-05-26 Thread Alex James
Alex James added the comment: >>> import subprocess >>> fileName = 'test_a5.py.out' >>> locator = 'step 5200 ' >>> p = subprocess.Popen('findstr /O /B /C:"' + locator + '" '+ fileName, stdout=subprocess.PIPE, shell=True) >>> print p.stdout.read() >>> print p.communicate()[0] And stderr is also

[issue6107] Subprocess.Popen output fails on Windows

2009-05-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The following works for me: >>> import subprocess >>> p=subprocess.Popen('findstr "disk" c:\\boot.ini', stdout=subprocess.PIPE) >>> print p.communicate()[0] default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="M

[issue6107] Subprocess.Popen output fails on Windows

2009-05-25 Thread Philip Jenvey
Philip Jenvey added the comment: Exactly what command line are you passing to subprocess? Does stderr contain anything? -- nosy: +pjenvey ___ Python tracker ___

[issue6107] Subprocess.Popen output fails on Windows

2009-05-25 Thread Alex James
New submission from Alex James : When calling p=subprocess.Popen(findstr "string" filename, stdout=PIPE) both p.stdout.read() and p.communicate()[0] 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 e