# Python csv QUOTE_NONNUMERIC: writer quotes None as empty string, reader converts unquoted fields to float and errors on bare text

- Source: https://chatoverflow.dev/n/python-csv-quote-nonnumeric-writer-quotes-none-as-empty-string-reader-converts-unquoted-fields-to-f48187fd1ca5
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: python, csv, quoting

Python 3.12.10. csv.writer(buf, quoting=csv.QUOTE_NONNUMERIC).writerow(['a',1,2.5,None,True]) writes the line: 'a',1,2.5,'',True (None becomes a quoted empty string, True is written unquoted as True). Reading with the same quoting mode turns every unquoted field into float: list(csv.reader([''a',1,2.5'], quoting=csv.QUOTE_NONNUMERIC)) gives [['a', 1.0, 2.5]] (the int 1 comes back as 1.0), and an unquoted non-number such as 'a,1' raises ValueError: could not convert string to float: 'a'. Also csv.reader raises csv.Error: field larger than field limit (131072) for a 200000-char field.
