Issue 6606: csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly (original) (raw)

Created on 2009-07-30 20:24 by jtate, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
foo.py jtate,2009-07-30 20:24 Test case showing broken dialect detection
test_csv.py.diff twb,2009-07-31 04:16 Tests csv doublequote sniffing
csv.py.diff twb,2009-07-31 04:22 Adds support for sniffing doublequote property
Messages (14)
msg91109 - (view) Author: Joseph Tate (jtate) Date: 2009-07-30 20:24
Given the attached code, the Sniffer.sniff routine does not set the doublequote property. This results in errors during reader operations. If the doublequote property is set in the dialect, the data is read properly. The data was created using oocalc, forcing it to use ascii quotes rather than u'\u201c\u201d'.
msg91110 - (view) Author: Joseph Tate (jtate) Date: 2009-07-30 20:25
Note that no exceptions are raised, the reader just returns improperly parsed records.
msg91122 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 03:35
The Sniffer.sniff routine doesn't set the doublequote property at all right now. I'm working on a patch to see if I can add this functionality.
msg91123 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 04:16
Test for this issue.
msg91124 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 04:17
Patch for the issue. Looks for extraneous quote inside the quotes by the delimiters.
msg91125 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 04:19
The documentation doesn't actually say what parameters are sniffed, so technically, that doesn't need to be changed. Should this be added?
msg91126 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 04:22
Reformatted line in patch.
msg91143 - (view) Author: Thomas W. Barr (twb) Date: 2009-07-31 19:26
Patch uploaded to rietveld: http://codereview.appspot.com/96202/show
msg93113 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-09-25 16:41
Thanks. I don't know how to use Reitveld. What am I supposed to do with that? S
msg93184 - (view) Author: Thomas W. Barr (twb) Date: 2009-09-27 20:37
I'm not actually sure where we go from here. This is my first attempted patch to this project, and I was hoping that someone else would be more knowledgeable about the process;-)
msg93187 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-09-28 01:23
Thomas, is the patch you uploaded to rietveld the same as the patches attached to the ticket? If so, Skip can just ignore the rietveld and work from the patch files. Rietveld is really more useful for reviews of longer patches than this one; for patches this size we generally just use the tracker.
msg93188 - (view) Author: Thomas W. Barr (twb) Date: 2009-09-28 02:08
Got it. Yes, they're the same patch.
msg93189 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-09-28 02:13
Applied to trunk as rev 75102.
msg93210 - (view) Author: Joseph Tate (jtate) Date: 2009-09-28 14:19
Thank you, Thomas, for the patch, and Skip, for applying it.
History
Date User Action Args
2022-04-11 14:56:51 admin set github: 50855
2009-09-28 14:19:19 jtate set messages: +
2009-09-28 02:13:18 skip.montanaro set status: open -> closedresolution: acceptedmessages: +
2009-09-28 02:08:03 twb set messages: +
2009-09-28 01:23:46 r.david.murray set priority: normalnosy: + r.david.murraymessages: +
2009-09-27 20:37:05 twb set messages: +
2009-09-25 16:41:08 skip.montanaro set messages: +
2009-09-25 01:20:18 rhettinger set assignee: skip.montanaronosy: + skip.montanaro
2009-07-31 19:26:50 twb set messages: +
2009-07-31 04:22:31 twb set files: + csv.py.diffmessages: +
2009-07-31 04:20:49 twb set files: - csv.py.diff
2009-07-31 04:19:41 twb set messages: +
2009-07-31 04:17:23 twb set files: + csv.py.diffmessages: +
2009-07-31 04:16:15 twb set files: + test_csv.py.diffkeywords: + patchmessages: +
2009-07-31 03:35:30 twb set type: behavior -> enhancementmessages: + nosy: + twb
2009-07-30 20:25:39 jtate set messages: +
2009-07-30 20:24:51 jtate create