[New-bugs-announce] [issue10197] subprocess.getoutput fails on win32
jldm
report at bugs.python.org
Tue Oct 26 14:19:01 CEST 2010
New submission from jldm <j_l_domenech at yahoo.com>:
Hi, first of all sorry for my English.
On windows XP SP3, the following code:
import subprocess
subprocess.getoutput("dir")
returns
'"{" is not recognized as an internal or external command,\noperable program or batch file.'
I made a workaround by changing in the file Lib/subprocess.py the line 574 (I thin in 3.2a3 is 584) (in the getstatusoutput(cmd) function definition) from:
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
to:
pipe = os.popen('( ' + cmd + '; ) 2>&1', 'r')
I have tested it with:
ActivePython 3.1.2.3 (ActiveState Software Inc.) based on
Python 3.1.2 (r312:79147, Mar 22 2010, 12:20:29) [MSC v.1500 32 bit (Intel)] on win32
and
Python 3.2a3 (r32a3:85355, Oct 10 2010, 17:11:45) [MSC v.1500 32 bit (Intel)] on win32
Regards from Spain.
José Luis Domenech
----------
messages: 119605
nosy: jldm
priority: normal
severity: normal
status: open
title: subprocess.getoutput fails on win32
type: behavior
versions: Python 3.1, Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10197>
_______________________________________
More information about the New-bugs-announce
mailing list