This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients astrand, debatem1, ned.deily
Date 2010-09-23.10:19:37
SpamBayes Score 8.3758556e-11
Marked as misclassified No
Message-id <1285237183.57.0.348540643055.issue9922@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 3, subprocess.Popen returns stdout as "bytes" rather than "string" so it seems reasonable that subprocess.getstatusoutput should do the same.

>>> subprocess.Popen(['dd if=/dev/random bs=1024 count=1'], shell=True, stdout=subprocess.PIPE).communicate()[0]
1+0 records in
1+0 records out
1024 bytes transferred in 0.000142 secs (7218432 bytes/sec)
b'\x11\xfb\xe1w ...

The problem is reproducible on 3.1 and py3k.

The attached patch for py3k (with a backport to 3.1) corrects getstatusoutput to return bytes.  It also includes a test case and updates the docs to show byte output.
History
Date User Action Args
2010-09-23 10:19:43ned.deilysetrecipients: + ned.deily, astrand, debatem1
2010-09-23 10:19:43ned.deilysetmessageid: <1285237183.57.0.348540643055.issue9922@psf.upfronthosting.co.za>
2010-09-23 10:19:41ned.deilylinkissue9922 messages
2010-09-23 10:19:39ned.deilycreate