From cc567a3e4bf788ec6d0017805f31523872ae27fa Mon Sep 17 00:00:00 2001 From: Ernesto Ruge Date: Thu, 24 Oct 2024 08:22:00 +0200 Subject: [PATCH] Windows newline fix --- scripts/_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_helper.py b/scripts/_helper.py index 2abdc49..4fab230 100644 --- a/scripts/_helper.py +++ b/scripts/_helper.py @@ -10,7 +10,7 @@ def load_duplicates(duplicates_file_path: Path, ignore: bool = False) -> list[tuple[int, int]]: old_duplicates: list[tuple[int, int]] = [] first = True - with open(duplicates_file_path) as duplicates_file: + with open(duplicates_file_path, newline='') as duplicates_file: rows = csv.reader(duplicates_file) for row in rows: if first: @@ -45,7 +45,7 @@ def save_duplicates(duplicates_file_path: Path, items: list[dict], append: bool 'public_url', 'opening_hours', ] - with open(duplicates_file_path, 'a' if append else 'w') as duplicates_file: + with open(duplicates_file_path, 'a' if append else 'w', newline='') as duplicates_file: duplicate_csv = csv.writer(duplicates_file) # Write header if not appending if append is False: