diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-19 19:20:03 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-08-19 19:20:03 (GMT) |
commit | a19de803e4661af947938df2db72d0cd5538f4a4 (patch) | |
tree | 2ee7a770a1529a23b0eddae70cc383361676d369 /Lib/subprocess.py | |
parent | 377a152e0dab743b165236024f50602a325d8b93 (diff) | |
parent | 828607170da3986af909defe99f956e5762e4dd0 (diff) | |
download | cpython-a19de803e4661af947938df2db72d0cd5538f4a4.zip cpython-a19de803e4661af947938df2db72d0cd5538f4a4.tar.gz cpython-a19de803e4661af947938df2db72d0cd5538f4a4.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 249b5f6..cec1a24 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -828,8 +828,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 |