8000 bpo-34108: Fix double carriage return in 2to3 on Windows by jaraco · Pull Request #8271 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34108: Fix double carriage return in 2to3 on Windows #8271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-34108: Honor newlines as present in the original file.
  • Loading branch information
jaraco committed Jul 13, 2018
commit bdd249c68f7552a408460c21509795f911cde201
2 changes: 1 addition & 1 deletion Lib/lib2to3/refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def write_file(self, new_text, filename, old_text, encoding=None):
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
Expand Down
0