Skip to content

Commit

Permalink
Explicitly set newline when rewriting for release (#7600)
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored and pradyunsg committed Jan 18, 2020
1 parent f1cf84e commit c55eee4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/automation/release/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
These are written according to the order they are called in.
"""

import io
import os
import subprocess
from typing import List, Optional, Set
Expand Down Expand Up @@ -70,7 +69,7 @@ def generate_authors(filename: str) -> None:
authors = get_author_list()

# Write our authors to the AUTHORS file
with io.open(filename, "w", encoding="utf-8") as fp:
with open(filename, "w", encoding="utf-8", newline="\n") as fp:
fp.write(u"\n".join(authors))
fp.write(u"\n")

Expand All @@ -90,7 +89,7 @@ def update_version_file(version: str, filepath: str) -> None:
content = list(f)

file_modified = False
with open(filepath, "w", encoding="utf-8") as f:
with open(filepath, "w", encoding="utf-8", newline="\n") as f:
for line in content:
if line.startswith("__version__ ="):
f.write('__version__ = "{}"\n'.format(version))
Expand Down

0 comments on commit c55eee4

Please sign in to comment.