From 389443117c714747d149f7bdf751fe3acf4c1690 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Thu, 23 Jan 2020 13:15:36 +0530 Subject: [PATCH] Revert "Explicitly set newline when rewriting for release (#7600)" This reverts commit c55eee4188638a861a8a12413e78e4ae763718fd. --- tools/automation/release/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/automation/release/__init__.py b/tools/automation/release/__init__.py index 0e26806c4..e983f4cbb 100644 --- a/tools/automation/release/__init__.py +++ b/tools/automation/release/__init__.py @@ -3,6 +3,7 @@ These are written according to the order they are called in. """ +import io import os import subprocess from typing import List, Optional, Set @@ -69,7 +70,7 @@ def generate_authors(filename: str) -> None: authors = get_author_list() # Write our authors to the AUTHORS file - with open(filename, "w", encoding="utf-8", newline="\n") as fp: + with io.open(filename, "w", encoding="utf-8") as fp: fp.write(u"\n".join(authors)) fp.write(u"\n") @@ -89,7 +90,7 @@ def update_version_file(version: str, filepath: str) -> None: content = list(f) file_modified = False - with open(filepath, "w", encoding="utf-8", newline="\n") as f: + with open(filepath, "w", encoding="utf-8") as f: for line in content: if line.startswith("__version__ ="): f.write('__version__ = "{}"\n'.format(version))