[issue14737] subprocess.Popen pipes not working

2012-05-06 Thread ganges master

New submission from ganges master gangesmas...@users.sourceforge.net:

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(becho 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(becho 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(becho hello\n)
 p.stdout.readline()
'hello\n'


--
components: Library (Lib)
messages: 160075
nosy: gangesmaster
priority: normal
severity: normal
status: open
title: subprocess.Popen pipes not working
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14737
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14737] subprocess.Popen pipes not working

2012-05-06 Thread Antoine Pitrou

Antoine Pitrou pit...@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(becho hello\n)
11
 p.stdout.readline()
b'hello\n'


Try calling p.stdin.flush() perhaps?

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14737
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14737] subprocess.Popen pipes not working

2012-05-06 Thread ganges master

ganges master gangesmas...@users.sourceforge.net added the comment:

hmm, it does work when i call flush, but it works perfectly fine without 
flushing on python2.x... i guess this has to do with str/bytes again. maybe 
this should be documented somewhere? thanks for the tip though.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14737
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14737] subprocess.Popen pipes not working

2012-05-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Nothing to do with str/bytes, actually; I think it was fixed in #11459 
(changeset 7451da272111), so you might want to upgrade your Python 3.2 (or use 
the flush() workaround).

--
resolution:  - out of date
stage:  - committed/rejected
status: open - closed
superseder:  - Python select.select does not correctly report read readyness

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14737
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com