summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-09-21 19:10:56 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-09-21 19:10:56 (GMT)
commitafe8d0646c9347960e99f5373d6cbd712b5376bb (patch)
tree1ece533b911f8668dd96e22f6d30e0d78a310c89 /Lib/subprocess.py
parent3f40c40dea5f68fa4f1711c9cfa04c4edf6f8f53 (diff)
downloadcpython-afe8d0646c9347960e99f5373d6cbd712b5376bb.zip
cpython-afe8d0646c9347960e99f5373d6cbd712b5376bb.tar.gz
cpython-afe8d0646c9347960e99f5373d6cbd712b5376bb.tar.bz2
Issue #21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line buffering, rather than block buffering.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index ddc033a..bc0ef0b 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -837,7 +837,8 @@ class Popen(object):
if p2cwrite != -1:
self.stdin = io.open(p2cwrite, 'wb', bufsize)
if universal_newlines:
- self.stdin = io.TextIOWrapper(self.stdin, write_through=True)
+ self.stdin = io.TextIOWrapper(self.stdin, write_through=True,
+ line_buffering=(bufsize == 1))
if c2pread != -1:
self.stdout = io.open(c2pread, 'rb', bufsize)
if universal_newlines: