mishandling of embedded NULs (was: Re: [Csv] trial zip/tar packages of csv module available)

John Machin sjmachin at lexicon.net
Sun Feb 16 20:43:27 CET 2003


On 16 Feb 2003 22:04:59 +1100, Dave Cole <djc at object-craft.com.au> wrote:

>>>>>> "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.
>
Dave> The '\0' to indicate line termination is a hang over from my original
Dave> code.  There is no reason why the code could not just use '\n' to
Dave> signal end of line (like every one else on the planet).

Are you sure? I had the impression that it was used as an out-of-band 
signal -- something that didn't appear in the data (you hope!) -- so that 
you could take exception to newlines that weren't at the end of line.

 


More information about the Csv mailing list