Message117176
| 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:43 | ned.deily | set | recipients:
+ ned.deily, astrand, debatem1 |
| 2010年09月23日 10:19:43 | ned.deily | set | messageid: <1285237183.57.0.348540643055.issue9922@psf.upfronthosting.co.za> |
| 2010年09月23日 10:19:41 | ned.deily | link | issue9922 messages |
| 2010年09月23日 10:19:39 | ned.deily | create |
|