Issue #12591: Improve support of "universal newlines" in the subprocess

module: the piped streams can now be properly read from or written to.

(this was broken due to the 2.x to 3.x transition; communicate() support
is still sketchy)
This commit is contained in:
Antoine Pitrou 2011-07-23 22:03:45 +02:00
parent e96ec68101
commit ab85ff3d1a
3 changed files with 52 additions and 17 deletions

View file

@ -721,7 +721,7 @@ class Popen(object):
if p2cwrite != -1:
self.stdin = io.open(p2cwrite, 'wb', bufsize)
if self.universal_newlines:
self.stdin = io.TextIOWrapper(self.stdin)
self.stdin = io.TextIOWrapper(self.stdin, write_through=True)
if c2pread != -1:
self.stdout = io.open(c2pread, 'rb', bufsize)
if universal_newlines: