[issue10515] csv sniffer does not recognize quotes at the end of line

2022-03-01 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> csv.Sniffer.sniff() regex error ___ Python tracker

[issue10515] csv sniffer does not recognize quotes at the end of line

2019-03-15 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10515] csv sniffer does not recognize quotes at the end of line

2015-02-24 Thread Mark Lawrence
Mark Lawrence added the comment: @David could you check Skip's patch out please. It seems identical to your own other than changing the delimiter from the empty string to a comma. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org

[issue10515] csv sniffer does not recognize quotes at the end of line

2011-03-19 Thread Skip Montanaro
Changes by Skip Montanaro s...@pobox.com: -- assignee: skip.montanaro - nosy: -skip.montanaro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I agree that the unquoted single column cases look weird. But changing it could affect other cases were there is more data. I'll leave that problem to you :) But I do not think that should be backported. The locals trick I stole from

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-19 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: Also, this comment in test_csv.py puzzles me: # given that all three lines in sample3 are equal, # I think that any character could have been 'guessed' as the # delimiter, depending on dictionary order As a human looking

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-19 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: Here's my candidate patch. Instead of returning an empty string as the delimiter it returns a comma. -- Added file: http://bugs.python.org/file20111/csv_delimiter_tests.patch ___ Python tracker

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-16 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - skip.montanaro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-14 Thread Martin Budaj
Martin Budaj m.bu...@gmail.com added the comment: What do you mean by there is a test for this case in csv.py? I meant test in regex on line 217 in python 2.7 and the following code (line 258ff): # there is *no* delimiter, it's a single column of quoted data delim = '' skipinitialspace = 0

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-11 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: From the comment in the test_csv.py: +# XXX: I don't know what the correct behavior should be for these. +# Currently the first one raises an error that the delimiter can't +# be determined while the second one returns

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Yeah, obviously wrong. I forgot to finish editing the comment. I think a fallback of ',' makes more sense than ''. What would a delimiter of nothing mean? I don't think the unquoted case can be changed for backward compatibility

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: What do you mean by there is a test for this case in csv.py? If I run sniffer against abcde\ndefgh\n I get a delimiter of 'e'. If I run it against 'a\nb\n', I get the could not determine delimiter error. Attached is a reformulated

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Forgot to attach the patch. -- Added file: http://bugs.python.org/file20006/csv_delimiter_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-04 Thread Martin Budaj
Martin Budaj m.bu...@gmail.com added the comment: I'm not sure about what the intended behavior for testAl should be, however I think that the file should be recognized as having one column of data and no delimiter (there is a test for this case in csv.py) and not raise an exception. I attach

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-02 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Are you sure testA1 is correct? It seems to me that in that case the sniffer can indeed not determine the delimiter, but I don't really understand the guessing algorithm. The existing behavior on unquoted strings is...interesting :)

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-24 Thread Martin Budaj
Martin Budaj m.bu...@gmail.com added the comment: Units test and two patches for 2.7 are included. p1.patch fixes testEnd case reported yesterday After running unittest it seems that also other case is broken (testAl -- if there is just one data item on the line, enclosed in quotes). Patch p2

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-24 Thread Ned Deily
Changes by Ned Deily n...@acm.org: Added file: http://bugs.python.org/file19800/test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___ ___

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-24 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- keywords: +patch Added file: http://bugs.python.org/file19802/p1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-24 Thread Ned Deily
Ned Deily n...@acm.org added the comment: (Thanks. I've unpacked and uploaded the three files from your tar file.) -- stage: unit test needed - patch review Added file: http://bugs.python.org/file19803/p2.patch ___ Python tracker

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-23 Thread Martin Budaj
New submission from Martin Budaj m.bu...@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 '(?Pdelim[^\w\n\'])(?Pspace

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-23 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Thanks for the report. It would be helpful if you could supply a patch including a unit test for this against 3.2 and/or 2.7. Note only security issues are accepted for 2.6. -- nosy: +ned.deily stage: - unit test needed versions: +Python 3.2

[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-23 Thread Andrew McNamara
Changes by Andrew McNamara andr...@object-craft.com.au: -- nosy: +andrewmcnamara ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___ ___