mishandling of embedded NULs (was: Re: [Csv] trial zip/tar packages of csv module available)
Dave Cole
djc at object-craft.com.au
Sun Feb 16 12:04:59 CET 2003
>>>>> "Skip" == Skip Montanaro <skip at pobox.com> writes:
Skip> (Last message before leaving for the plane...)
>>> (Should an exception be raised on output as well?)
John> Yes, but conditionally -- IMHO the caller should be able to
John> specify (strictwriting=True) that an exception should be raised
John> on *any* attempt to write data that could not be read back
John> "sensibly"...
Skip> I believe the issue of reading/writing NUL bytes this is just a
Skip> temporary limitation of the current implementation. It will be
Skip> fixed it in the future (it has to, because some Unicode
Skip> encodings will read or write NULs in the data stream), so we
Skip> don't need to get very elaborate with our handling of NULs. For
Skip> now, simply raising an exception should suffice.
The '\0' to indicate line termination is a hang over from my original
code. There is no reason why the code could not just use '\n' to
signal end of line (like every one else on the planet).
- Dave
--
http://www.object-craft.com.au
More information about the Csv
mailing list