[issue14737] subprocess.Popen pipes not working

Antoine Pitrou report at bugs.python.org
Sun May 6 13:55:40 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

Works with 3.2.2:

Python 3.2.2+ (3.2:9ef20fbd340f, Oct 15 2011, 21:22:07) 
[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()
b'hello\n'


Try calling p.stdin.flush() perhaps?

----------
nosy: +gregory.p.smith, pitrou

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


More information about the Python-bugs-list mailing list