diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-09-21 19:15:42 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-09-21 19:15:42 (GMT) |
commit | 6e311aa748b123b1f1333c2c86b5904b57168276 (patch) | |
tree | 0577b6fab7a1380f5e552ba846d0fb108b5e57e2 /Lib/subprocess.py | |
parent | 9e7fbde67f55e8e5c21bc41568c7fe13e72b44bc (diff) | |
parent | afe8d0646c9347960e99f5373d6cbd712b5376bb (diff) | |
download | cpython-6e311aa748b123b1f1333c2c86b5904b57168276.zip cpython-6e311aa748b123b1f1333c2c86b5904b57168276.tar.gz cpython-6e311aa748b123b1f1333c2c86b5904b57168276.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.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index bb7d0dc..3ce0ed1 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -841,7 +841,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: |