From fa0d4d9d96695b929328198a13501141f86c8d4e Mon Sep 17 00:00:00 2001 From: Justin Waring Date: Fri, 12 Jun 2020 08:45:24 -0400 Subject: [PATCH 1/2] Write \n newlines --- doorstop/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doorstop/common.py b/doorstop/common.py index bf386ca0b..62d170b91 100644 --- a/doorstop/common.py +++ b/doorstop/common.py @@ -160,11 +160,12 @@ def write_lines(lines, path, end='\n', encoding='utf-8'): return path -def write_text(text, path): +def write_text(text, path, end='\n'): """Write text to a file. :param text: string :param path: file to write text + :param end: string to end lines :param encoding: output file encoding :return: path of new file @@ -172,7 +173,7 @@ def write_text(text, path): """ if text: log.trace("writing text to '{}'...".format(path)) # type: ignore - with open(path, 'w', encoding='utf-8') as f: + with open(path, 'w', encoding='utf-8', newline=end) as f: f.write(text) return path From ff994be1f9d9c71b7c7e11f06c4860f0e9ed07df Mon Sep 17 00:00:00 2001 From: Justin Waring Date: Thu, 9 Jul 2020 10:06:22 -0400 Subject: [PATCH 2/2] retrigger checks