This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients bobbyocean, danieljewell, r.david.murray, remi.lapeyre, serhiy.storchaka, skip.montanaro
Date 2020-05-30.11:40:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590838858.54.0.744903534259.issue27580@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-05-30 11:40:58remi.lapeyresetrecipients: + remi.lapeyre, skip.montanaro, r.david.murray, serhiy.storchaka, bobbyocean, danieljewell
2020-05-30 11:40:58remi.lapeyresetmessageid: <1590838858.54.0.744903534259.issue27580@roundup.psfhosted.org>
2020-05-30 11:40:58remi.lapeyrelinkissue27580 messages
2020-05-30 11:40:58remi.lapeyrecreate