Ross Lagerwall rosslagerw...@gmail.com added the comment:
Unbuffered subprocess was fixed in 1dc52ecb8949
Closing this as a duplicate of #11459.
--
nosy: +rosslagerwall
resolution: - duplicate
status: open - closed
___
Python tracker
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
I implemented msg117279 with v2 patch. Can I commit it?
# If your are already working on this issue, please ignore
# my patch.
--
Added file:
http://bugs.python.org/file19280/py3k_fix_unbuffered_in_subprocess_v2.patch
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Umm, v2 patch broke test_subprocess. I'll repost v3 patch
after removing bufsize=0 universal_newlines check.
==
ERROR: test_universal_newlines
R. David Murray rdmur...@bitdance.com added the comment:
But if line buffering doesn't work, disabling buffering on stdout/stderr does
have a functional consequence: it allows process output to appear as generated
instead of coming in chunks when the buffer is full. Of course, I could be
Antoine Pitrou pit...@free.fr added the comment:
But if line buffering doesn't work, disabling buffering on
stdout/stderr does have a functional consequence: it allows process
output to appear as generated instead of coming in chunks when the
buffer is full
Yes, sorry, I had it backwards.
Antoine Pitrou pit...@free.fr added the comment:
But if line buffering doesn't work, disabling buffering on
stdout/stderr does have a functional consequence: it allows process
output to appear as generated instead of coming in chunks when the
buffer is full
Yes, sorry, I had it
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Antoine, can you create the patch? I'm not familiar with IO.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9929
___
Antoine Pitrou pit...@free.fr added the comment:
You are right that it doesn't work anymore (under Linux too).
Your patch is almost ok. It should raise a ValueError if bufsize=0 and
universal_newlines is true (the two can't be satisfied together, since
universal newlines implies buffering).
Antoine Pitrou pit...@free.fr added the comment:
As another sidenote, `bufsize` should only be relevant for stdin. For stdout
and stderr, disabling buffering will only reduce performance, not add
functionality. So I would suggest only setting buffering on stding.
--
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Following script hangs on Python3.x.
from subprocess import *
import sys
p = Popen([sys.executable, -c, import sys; print(sys.stdin.read(1))],
stdin=PIPE)
p.stdin.write(b'x')
p.wait()
This is because unbuffered functionality
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Interestingly, following code also hangs. Maybe I'm
misunderstanding the meaning of *bufsize*
from subprocess import *
import sys
p = Popen([sys.executable, -c, import sys; print(sys.stdin.read(1))],
stdin=PIPE)
11 matches
Mail list logo