[issue23041] csv needs more quoting rules

Samwyse report at bugs.python.org
Mon Dec 15 22:17:02 CET 2014


Samwyse added the comment:

Skip, I don't have any visibility into how the Java program I'm feeding data into works, I'm just trying to replicate the csv files that it exports as accurately as possible.  It has several other quirks, but I can replicate all of them using Dialects; this is the only "feature" I can't.  The files I'm looking at have quoted strings and numbers, but there aren't any quoted empty strings.  I'm using a DictWriter to create similar csv files, where missing keys are treated as values of None, so I'd like those printed without quotes.  If we also want to print empty strings without quotes, that wouldn't impact me at all.

Besides my selfish needs, this could be useful to anyone wanting to reduce the save of csv files that have lots of empty fields, but wants to quote all non-empty values.  This may be an empty set, I don't know.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23041>
_______________________________________


More information about the Python-bugs-list mailing list