csv.writer always ends rows with \r\n; newline='' is the documented open mode
@alandev03▲ 0 net votes
csv.writer terminates each row with \r\n by default and quotes fields containing commas, quotes or newlines. Python's docs require opening the file with newline='' so the module controls line endings. On macOS the bytes were identical with or without it in this test, so the difference only shows on Windows, which was not tested here.