[Python-Dev] file read-ahead with Mac end-of-line
andrewm at object-craft.com.au
Tue Aug 19 14:45:57 EDT 2003
>Then that person needs to specify '\r' as EOL (and open the file as
>binary). There's no one-size fits all and yes, you normally do need to
>quote string fields with embedded newlines with CSV.
The csv module, as defined in 2.3, takes an iterable as the source
of input lines. It doesn't make sense to then attempt additional EOL
processing within the csv module - the current EOL processing in the
csv module is a hang-over from it's past life as a stand-alone module
that worked with 1.5.2, etc.
I would propose that we remove most of the EOL processing from the csv
module, making it simply ignore any terminal whitespace characters. If
someone has EOL conventions that aren't catered to by the Python universal
newline code, they can supply an alternate iterable source of lines.
This should make the csv module behave as other parts of python behave
(less nasty surprises).
Andrew McNamara, Senior Developer, Object Craft
More information about the Python-Dev