Author bpoaugust
Recipients bpoaugust, brian.curtin, eric.araujo, jldm, ned.deily, r.david.murray, vstinner
Date 2011-10-17.22:30:03
SpamBayes Score 8.0002e-05
Marked as misclassified No
Message-id <1318890604.47.0.432666191633.issue10197@psf.upfronthosting.co.za>
In-reply-to
Content
A better fix, which supports multiple windows commands:

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

This works with the command

subprocess.getoutput("echo before & python -V & echo after")

Note that python -V writes to stderr, so without the enclosing ( ) the version information is not captured.
History
Date User Action Args
2011-10-17 22:30:04bpoaugustsetrecipients: + bpoaugust, vstinner, ned.deily, eric.araujo, r.david.murray, brian.curtin, jldm
2011-10-17 22:30:04bpoaugustsetmessageid: <1318890604.47.0.432666191633.issue10197@psf.upfronthosting.co.za>
2011-10-17 22:30:03bpoaugustlinkissue10197 messages
2011-10-17 22:30:03bpoaugustcreate