[Csv] Thoughts about a patch

Andrew McNamara andrewm at object-craft.com.au
Mon Mar 15 00:26:51 CET 2004


>I guess I just haven't understood the code well enough yet, but in the
>parsing code there are comparisons of the type
>
>  if (c == '\n')
>
>I suppose the newlines are normalized versions of lineterminator? In
>other words, no matter what the line terminator is, it is safe to
>pretend that it has been changed to '\n' in the parsing case
>statement? Or? (I mean, I've tried to use lineterminator='|' and that
>worked just nicely, but I don't see the use of lineterminator in the
>case statement anywhere.)

One thing to bear in mind is the history of the CSV module - it dates back
to Python 1.5 times, when python didn't have universal newline support.

If I remember correctly, lineterminator is only used when generating CSV
output, not when parsing input. On input, the value of lineterminator
is ignored, and \r and \n are hard-coded.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/


More information about the Csv mailing list