Skip to content

Commit

Permalink
Windows newline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Oct 24, 2024
1 parent cf3b138 commit cc567a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cc567a3

Please sign in to comment.