mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
Issue #15595: Fix subprocess.Popen(universal_newlines=True)
for certain locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
This commit is contained in:
commit
a19de803e4
3 changed files with 37 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue