Skip to content

Commit

Permalink
Fix CSV export on Windows
Browse files Browse the repository at this point in the history
csv.reader() already generates \r\n line endings on Windows, so tell
open() not to convert those \n's into more \r\n's, which would produce
\r\r\n line endings.
  • Loading branch information
mgedmin committed May 2, 2020
1 parent bea320a commit 3163f4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitlab_jobs.py
Expand Up @@ -207,7 +207,7 @@ def main():

if args.csv:
print("\nWriting {filename}...".format(filename=args.csv))
with open(args.csv, 'w') as f:
with open(args.csv, 'w', newline='') as f:
writer = csv.writer(f)
for job_name, durations in sorted(job_durations.items()):
writer.writerow([job_name] + durations)
Expand Down

0 comments on commit 3163f4d

Please sign in to comment.