[New-bugs-announce] [issue10515] csv sniffer does not recognize quotes at the end of line

Martin Budaj report at bugs.python.org
Tue Nov 23 18:55:42 CET 2010


New submission from Martin Budaj <m.budaj at gmail.com>:

The method Sniffer._guess_quote_and_delimiter() in the module csv.py contains a bug in a regexp which checks for quotes around the last item of the line (example: a,b,"c,d"\n).

the pattern
'(?P<delim>>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)'
used in the regex should be changed to
'(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)'

file csv.py: line 212 in python 2.6, line 216 in 2.7, line 207 in 3.1

----------
components: Library (Lib)
messages: 122227
nosy: Martin.Budaj
priority: normal
severity: normal
status: open
title: csv sniffer does not recognize quotes at the end of line
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1

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


More information about the New-bugs-announce mailing list