[issue24787] csv.Sniffer guesses "M" instead of \t or , as the delimiter

Skip Montanaro report at bugs.python.org
Tue Aug 4 17:29:13 CEST 2015


Skip Montanaro added the comment:

I should have probably pointed out that the Sniffer class is the unloved stepchild of the csv module. In my experience it is rarely necessary. You either:

* Are reading CSV files which are about what Excel would produce with its default settings

or

* Know just what your format is, and can define the various parameters easily

It's pretty rare, I think, to get a delimited file in some format which is completely unknown and which thus has to be deduced.

As Peter showed, the Sniffer class is also kind of unreliable. I didn't write it, and there are precious few test cases for it. One of your datasets should probably be added to the mix and bugs fixed.

----------

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


More information about the Python-bugs-list mailing list