Pavel Shpilev <p.shpi...@gmail.com> added the comment:

I know that CSV specification says empty field and empty string are the same, 
however, I still believe there is practical use for unconventional processing 
of such fields.

In our specific case we parse CSVs produced by Amazon Athena (based on Presto) 
in which NULL and empty string values represented as above. Following CSV specs 
dogmatically, there's no way to distinguish between the two, but pragmatically 
you can tell them apart by simply looking at values.

Brief search shows we aren't the only ones facing the issue. After giving it 
some more thought, I'd agree that csv.QUOTE_ALL doesn't make much sense here, 
but may be an extra argument to csv.reader() will do the trick? Something like 
csv.reader(detect_none_values=False/True), with False being default, and 
emphasis in the documentation that True goes against CSV specification.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32919>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to