[issue30157] csv.Sniffer.sniff() regex error

Matthew Barnett report at bugs.python.org
Tue Apr 25 12:02:43 EDT 2017


Matthew Barnett added the comment:

There are 4 patterns. They try to determine the delimiter and quote by looking for matches. Each pattern supposedly covers one of 4 cases:

1. Delimiter, quote, value, quote, delimiter.

2. Start of line/text, quote, value, quote, delimiter.

3. Delimiter, quote, value, quote, end of line/text.

4. Start of line/text, quote, value, quote, end of line/text.

On that basis, case 3 looks wrong because the pattern for delimiter is:

    >[^\w\n"\']

instead of the expected:

    [^\w\n"\']

Looks like a bug to me.

----------
nosy: +mrabarnett

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


More information about the Python-bugs-list mailing list