diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2018-07-13 11:26:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 11:26:03 -0400 |
commit | cafaf0447b950fd4f59edd8cbde040c61ae528f8 (patch) | |
tree | 16bc635ab64861d1714134a6dafa810fb2b9b45a /Lib/lib2to3/refactor.py | |
parent | 379e9d639a52766f79c7a206c5096c8333d1896f (diff) | |
download | cpython-git-cafaf0447b950fd4f59edd8cbde040c61ae528f8.tar.gz |
bpo-34108: Fix double carriage return in 2to3 on Windows (#8271)
* Add test capturing failure.
* Honor newlines as present in the original file.
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 7c4e064997..7841b99a5c 100644 --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -514,7 +514,7 @@ class RefactoringTool(object): set. """ try: - fp = io.open(filename, "w", encoding=encoding) + fp = io.open(filename, "w", encoding=encoding, newline='') except OSError as err: self.log_error("Can't create %s: %s", filename, err) return |