summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2021-08-17 12:16:41 +0200
committerMarge Bot <emma+marge@anholt.net>2022-01-16 08:39:44 +0000
commitb6cc240db1cab25b94b5d471c730185ad374b2b9 (patch)
tree91c9ef0f001c93cc76aef92c3ad464696f2d9dbc /bin
parent493f68833128959539a6e202a6cfb18ab76bcf12 (diff)
downloadmesa-b6cc240db1cab25b94b5d471c730185ad374b2b9.tar.gz
bin/gen_calendar_entries: fix newlines on windows
The documentation[1] for the csv module specifies that we should specify newline='' when opening the output file. Without that, the module garbles the newlines, writing them as \r\r\n on Windows instead of \r\n. So let's do what the documentation says, and specify newline='' [1]: https://docs.python.org/3/library/csv.html#id3 Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12405>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gen_calendar_entries.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/gen_calendar_entries.py b/bin/gen_calendar_entries.py
index 711702e28ac..96772ddc016 100755
--- a/bin/gen_calendar_entries.py
+++ b/bin/gen_calendar_entries.py
@@ -105,7 +105,7 @@ def release_candidate(args: RCArguments) -> None:
data = read_calendar()
- with CALENDAR_CSV.open('w') as f:
+ with CALENDAR_CSV.open('w', newline='') as f:
writer = csv.writer(f)
writer.writerows(data)
@@ -147,7 +147,7 @@ def final_release(args: FinalArguments) -> None:
data = read_calendar()
date = _calculate_next_release_date(not args.zero_released)
- with CALENDAR_CSV.open('w') as f:
+ with CALENDAR_CSV.open('w', newline='') as f:
writer = csv.writer(f)
writer.writerows(data)
@@ -199,7 +199,7 @@ def extend(args: ExtendArguments) -> None:
current = read_calendar()
- with CALENDAR_CSV.open('w') as f:
+ with CALENDAR_CSV.open('w', newline='') as f:
writer = csv.writer(f)
with write_existing(writer, current) as row:
# Get rid of -rcX as well