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 gangesmaster
Recipients gangesmaster
Date 2012-05-06.11:43:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336304615.86.0.376011401786.issue14737@psf.upfronthosting.co.za>
In-reply-to
Content
Attempting to read from stdout of a running process seems broken on Python3.2. I've been able to reproduce this on Ubuntu 11.4 and Windows 7 (with /bin/sh installed as part of git for windows)

Python 3.2 (r32:88445, Dec  8 2011, 15:26:51) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen, PIPE
>>> p=Popen(["/bin/sh"], stdin=PIPE, stderr=PIPE, stdout=PIPE)
>>> p.stdin.write(b"echo hello\n")
11
>>> p.stdout.readline()
<stuck>

>>> from subprocess import Popen, PIPE
>>> p=Popen(["/bin/sh"], stdin=PIPE, stderr=PIPE, stdout=PIPE)
>>> p.stdin.write(b"echo hello\n")
11
>>> p.stdout.read(2)
<stuck>


For comparison, on python 2.7 (again, linux and windows:
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen, PIPE
>>> p=Popen(["/bin/sh"], stdin=PIPE, stderr=PIPE, stdout=PIPE)
>>> p.stdin.write(b"echo hello\n")
>>> p.stdout.readline()
'hello\n'
>>>
History
Date User Action Args
2012-05-06 11:43:35gangesmastersetrecipients: + gangesmaster
2012-05-06 11:43:35gangesmastersetmessageid: <1336304615.86.0.376011401786.issue14737@psf.upfronthosting.co.za>
2012-05-06 11:43:35gangesmasterlinkissue14737 messages
2012-05-06 11:43:34gangesmastercreate