[issue10197] subprocess.getoutput fails on win32

bpoaugust report at bugs.python.org
Mon Oct 17 19:22:49 CEST 2011


bpoaugust <sebbaz+bpo at gmail.com> added the comment:

subprocess.getoutput does not currently work at all on Windows.
So it's not necessary to maintain backwards compatibility.

The following fix works for me on WinXP/Python 3.2.2.

Replace

    pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r') # line 613 of subprocess.py

with

    if mswindows:
        pipe = os.popen(cmd + ' 2>&1', 'r') # Windows does not support { }
    else:
        pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')

----------
nosy: +bpoaugust
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10197>
_______________________________________


More information about the Python-bugs-list mailing list