[issue27580] CSV Null Byte Error

2021-11-26 Thread Petr Viktorin
Petr Viktorin added the comment: *docutils, not distutils -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27580] CSV Null Byte Error

2021-11-26 Thread Petr Viktorin
Petr Viktorin added the comment: The NUL check was around for a long time, available to be used (XKCD-1172 style) as a simple check against reading binary files. The change did break tests of distutils. Maybe it deserves a What's New entry? -- nosy: +petr.viktorin

[issue27580] CSV Null Byte Error

2021-10-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27580] CSV Null Byte Error

2021-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b454e8e4df73bc73bc1a6f597431f171bfae8abd by Serhiy Storchaka in branch 'main': bpo-27580: Add support of null characters in the csv module. (GH-28808) https://github.com/python/cpython/commit/b454e8e4df73bc73bc1a6f597431f171bfae8abd

[issue27580] CSV Null Byte Error

2021-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that rejecting the null character is just an implementation artifact. 0 is used both as signalling value for "not set" character parameter and as the end-of-line character in the state automata. We can use different values outside of the

[issue27580] CSV Null Byte Error

2021-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27127 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28808 ___ Python tracker

[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Skip, I'm on a Mac so I tried Numbers, the spreadsheet tool that comes with MacOS: Opening and exporting to CSV again works: ➜ ~ cat -v ~/Documents/nul.csv abc;def;1234.5;^@^M a-c;d^@f;1234.5;^@^M ABC;DEF;1.5;^@ When exporting to TSV, it makes the

[issue27580] CSV Null Byte Error

2020-05-30 Thread Skip Montanaro
Skip Montanaro added the comment: Looks like my comment removed Remi from the nosy list. Restoring that... -- nosy: +remi.lapeyre ___ Python tracker ___

[issue27580] CSV Null Byte Error

2020-05-30 Thread Skip Montanaro
Skip Montanaro added the comment: I'm sorry, but why is this issue coming up again after nearly four years? Especially without a patch? (I apologize. I've gotten a bit more grumpy as I've aged.) Let me summarize a bit of history. Back in the early 2000s, Dave Cole at Object Craft in

[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Writing to those files is obviously as easy, since like you said "because by it's very nature it's non-printable" and you will probably not find it in your data: with open('file', 'w') as f: f.write('\x00'.join(data)) It will break if there is a NULL

[issue27580] CSV Null Byte Error

2020-05-30 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I feel like the CSV module could support using NULL as separator and could send a PR with some test to add this but Daniel could you give more information regarding why you need explicit CSV support for this? The CSV parser is needed to read and write CSV

[issue27580] CSV Null Byte Error

2020-05-30 Thread Daniel Jewell
Daniel Jewell added the comment: Forgive my frustration, but @Skip I really don't see how the definition of CSV relating to Excel (or Gnumeric or LibreOffice) has any relevance as to whether or not the module (and perhaps Python more generally) supports chr(0x00) as a delimiter. (Neither

[issue27580] CSV Null Byte Error

2016-07-21 Thread Skip Montanaro
Skip Montanaro added the comment: Thanks. The display you showed looks about like I saw in LibreOffice. If you export it back to another CSV file, does the new file match the original exactly, or does (like LibreOffice) it save a file without NUL bytes? I don't mind having the discussion, but

[issue27580] CSV Null Byte Error

2016-07-21 Thread Bobby Ocean
Bobby Ocean added the comment: I attempted to open the file in excel; raised no errors. In any case (regardless of Microsoft-concerns), I am glad to see a discussion started and possibly some concern that an update might be useful to the community (it would certainly cut down on the number

[issue27580] CSV Null Byte Error

2016-07-21 Thread Skip Montanaro
Skip Montanaro added the comment: I wasn't familiar with RFC 4180. (Or, quite possibly, I forgot I used to be familiar with it.) Note that at the bottom of the BNF definition of the file structure is the definition of TEXTDATA: TEXTDATA = %x20-21 / %x23-2B / %x2D-7E That pretty explicitly

[issue27580] CSV Null Byte Error

2016-07-21 Thread Bobby Ocean
Bobby Ocean added the comment: I am sorry I must have mis-read the history part of that article. -- ___ Python tracker ___

[issue27580] CSV Null Byte Error

2016-07-21 Thread R. David Murray
R. David Murray added the comment: Bobby: Skip is one of the authors of the csv module, and has been maintaining it since it was added to the standard library. He knows whereof he speaks: there is no standard for csv (as noted in the article you link), and all csv parsers that want to be

[issue27580] CSV Null Byte Error

2016-07-21 Thread Bobby Ocean
Bobby Ocean added the comment: @ Skip Montanaro, Actually, CSV has nothing to do with excel. Excel is a gui that processes CSV like many other programs. CSV stands for comma seperated values and is basic standard for data.https://en.m.wikipedia.org/wiki/Comma-separated_values As far as I

[issue27580] CSV Null Byte Error

2016-07-21 Thread Skip Montanaro
Skip Montanaro added the comment: Beyond whether or not the csv module can handle NUL bytes, you might figure out if Excel will. Since the CSV format isn't some sort of "standard", its operational definition has always been what Excel will produce or consume. I don't have Excel (not a Windows

[issue27580] CSV Null Byte Error

2016-07-21 Thread R. David Murray
R. David Murray added the comment: By "discussed before" I presume you are referring to issue 1599055. It is true that have been changes since then in Python's handling of null bytes. Perhaps it is indeed time to revisit this. I'll leave that to the experts...this can be closed as a

[issue27580] CSV Null Byte Error

2016-07-21 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 3.6 -Python 3.5 ___ Python tracker ___

[issue27580] CSV Null Byte Error

2016-07-20 Thread Bobby Ocean
New submission from Bobby Ocean: I think this has been asked before, but it has been awhile and I think needs to be re-addressed. Why doesn't the CSV module handle NULL bytes? Let me do some examples, ascii = [chr(n) for n in range(256)] #No errors print(ascii) #No errors