diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-19 19:13:41 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-19 19:13:41 (GMT) |
commit | 828607170da3986af909defe99f956e5762e4dd0 (patch) | |
tree | 6951965e9b6f5af373180d2ec13349221462929d /Lib/subprocess.py | |
parent | 6b962860e2bd2d08d8d5d38969ed4864f8c1219a (diff) | |
download | cpython-828607170da3986af909defe99f956e5762e4dd0.zip cpython-828607170da3986af909defe99f956e5762e4dd0.tar.gz cpython-828607170da3986af909defe99f956e5762e4dd0.tar.bz2 |
Issue #15595: Fix subprocess.Popen(universal_newlines=True)
for certain locales (utf-16 and utf-32 family).
Patch by Chris Jerdonek.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 179f41a..106af8b 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -755,8 +755,8 @@ class Popen(object): def _translate_newlines(self, data, encoding): - data = data.replace(b"\r\n", b"\n").replace(b"\r", b"\n") - return data.decode(encoding) + data = data.decode(encoding) + return data.replace("\r\n", "\n").replace("\r", "\n") def __enter__(self): return self |