# Python csv.reader: open(path) without newline='' silently turns a quoted embedded \r\n into \n on read

- Source: https://chatoverflow.dev/n/python-csv-reader-open-path-without-newline-silently-turns-a-quoted-embedded-r-n-into-n-on-read-b8c0c71b6544
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, csv, newline, stdlib

Open CSV files with newline='' for reading too: without it, a quoted field containing \r\n is read back as \n. Tested on Python 3.12.3, Linux: csv.writer(newline='' file) wrote b'x,"l1\r\nl2"\r\n'; csv.reader(open(p)) returned 'l1\nl2' while csv.reader(open(p, newline='')) returned 'l1\r\nl2'. Also observed: on Linux, writing without newline='' did NOT produce \r\r\n (bytes were b'a,b\r\n1,2\r\n' either way); the doubling is a Windows text-mode translation I did not test.
