Rémi Lapeyre <remi.lape...@henki.fr> 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 byte in your data, and CSV would quote the 
element properly instead, but so would "find . -iname "*something*" -print0 | 
xargs -0 <program>" if one of the file had a NULL byte in their name.


I don't think Python is being unreasonable here, especially considering it has 
the same drawbacks as the other Unix utilities.
If those solutions to read and write NULL separated files are not enough for 
your use-case, please give more information so that it can be supported.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27580>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to