[issue25857] csv: unexpected result

2015-12-14 Thread R. David Murray
R. David Murray added the comment: Yeah, we'll leave it alone until someone actually submits an enhancment request...and the only way it'll get done is if they do it, I suspect :) -- ___ Python tracker ___

[issue25857] csv: unexpected result

2015-12-14 Thread Ioan Fintescu
Ioan Fintescu added the comment: If you consider that, you should take a look at the RFC; it also contains a BNF like grammar plus some pointers to another RFC (2234). It may require more effort that it is worth, absent some demand for it. ...muss On Mon, Dec 14, 2015 at 9:34 AM, R. David Murr

[issue25857] csv: unexpected result

2015-12-14 Thread R. David Murray
R. David Murray added the comment: There's no place to generate an error message, the csv module parsed the line according to the rules. I'm glad that there's an RFC now. There wasn't when the module was written (which was well before my time on this project...) -- _

[issue25857] csv: unexpected result

2015-12-14 Thread R. David Murray
R. David Murray added the comment: Oh, maybe there is. We could add an RFC-strict dialect that would raise an error, if I'm understanding your quotes from it correctly. That would be a new feature, though. -- ___ Python tracker

[issue25857] csv: unexpected result

2015-12-14 Thread Ioan Fintescu
Ioan Fintescu added the comment: There seems to be a CSV specification, namely IETF RFC 4180, and, as far as I can tell, it indicates you are correct, and I am wrong. Especially points 5., 6., and 7 on page 3. Here is a quote from 5 (RFC 4180, page 2

[issue25857] csv: unexpected result

2015-12-14 Thread R. David Murray
R. David Murray added the comment: Well, since there's no real standard for csv, it might have been. Since it is iherently ambiguous according to "normal" csv rules, though, I'd say that if that is the case the originating spreadsheet is the one with the bug. If you can prove there is a spre

[issue25857] csv: unexpected result

2015-12-13 Thread Ioan Fintescu
Ioan Fintescu added the comment: You may be right. I just saved it from LibreOffice Calc and I got [x=ā€aā€,"y=ā€b, cā€"]. I thought the original was saved from a spreadsheet program. ...muss On Sun, Dec 13, 2015 at 7:51 PM, Ioan Fintescu wrote: > You wrote ['x = "a"', 'y = "b, c"'] > I wrote [

[issue25857] csv: unexpected result

2015-12-13 Thread Ioan Fintescu
Ioan Fintescu added the comment: You wrote ['x = "a"', 'y = "b, c"'] I wrote ['x = "a", y = "b, c"'] ...muss On Sun, Dec 13, 2015 at 7:08 PM, R. David Murray wrote: > > R. David Murray added the comment: > > >>> b = io.StringIO() > >>> w = csv.writer(b) > >>> w.writerow(['x = "a"', 'y = "b, c

[issue25857] csv: unexpected result

2015-12-13 Thread R. David Murray
R. David Murray added the comment: >>> b = io.StringIO() >>> w = csv.writer(b) >>> w.writerow(['x = "a"', 'y = "b, c"']) 28 >>> b.getvalue() '"x = ""a""","y = ""b, c"""\r\n' In other words, your input was not validly quoted csv. -- nosy: +r.david.murray resolution: -> not a bug stage

[issue25857] csv: unexpected result

2015-12-13 Thread Ioan Fintescu
New submission from Ioan Fintescu: Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import csv >>> s = 'x = "a", y = "b, c"' >>> s 'x = "a", y = "b, c"' >>> for row in csv.rea