diff options
author | Aaron Ang <aaronang@users.noreply.github.com> | 2018-04-17 21:34:14 (GMT) |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2018-04-17 21:34:14 (GMT) |
commit | c127a86e1862df88ec6f9d15b79c627fc616766e (patch) | |
tree | cbe57da6b7018dc0334591e324b9795edc7d290d /Lib/lib2to3/refactor.py | |
parent | 36d56ea826caffbeac0fc0c6d90248b80516e33c (diff) | |
download | cpython-c127a86e1862df88ec6f9d15b79c627fc616766e.zip cpython-c127a86e1862df88ec6f9d15b79c627fc616766e.tar.gz cpython-c127a86e1862df88ec6f9d15b79c627fc616766e.tar.bz2 |
bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)
Diffstat (limited to 'Lib/lib2to3/refactor.py')
-rw-r--r-- | Lib/lib2to3/refactor.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py index db2e38d..7c4e064 100644 --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -314,7 +314,7 @@ class RefactoringTool(object): encoding = tokenize.detect_encoding(f.readline)[0] finally: f.close() - with io.open(filename, "r", encoding=encoding) as f: + with io.open(filename, "r", encoding=encoding, newline='') as f: return f.read(), encoding def refactor_file(self, filename, write=False, doctests_only=False): |