[Csv] Something's fishy w/ Mac line endings...

Andrew McNamara andrewm at object-craft.com.au
Tue Aug 19 05:56:50 CEST 2003


>    Andrew> And as there is no separate distribution of the new csv module,
>    Andrew> the 2.2 compatibility is pretty moot (you'd have to download 2.3
>    Andrew> and extract the module yourself).
>
>One of the arguments for making new modules work with the previous minor
>release is that they get adopted faster.  If people are stuck on 2.2.x for
>some reason, they can still parse csv files and either not have to wait for
>2.3 or change the way they do that when 2.3 is released.
>
>There's also the problem that 2.3.1 is supposed to be a bugfix release.
>Even though the csv module has only been around a short time and we aren't
>likely to break much, if any, code, changing the semantics needs to be
>considered carefully.  The assumption here is that to fix the bug properly
>we have to change the module's semantics.
>
>Also, what about writing?  If a user says they want Mac line endings, we
>have to guarantee that, right?  That means for writing we still require
>files be opened as 'wb', not 'wU', otherwise \r would get translated into
>the platform's actual EOL sequence.

The problem is that our end of line processing is incompatible with the
use of an iterator as the source of input lines - there is no satisfactory
answer that allows us to retain both.

The requirement that the input file be opened in binary mode for what
is obviously a text format is going to a never ending source of suprise
for people using the module, and seems like a bigger wart than the one
we're now facing.

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


More information about the Csv mailing list