mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)
This commit is contained in:
parent
36d56ea826
commit
c127a86e18
4 changed files with 35 additions and 18 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue