[Csv] Switch to universal mode?
Andrew McNamara
andrewm at object-craft.com.au
Thu Jun 17 03:19:59 CEST 2004
>You're right. Universal newline mode would hose those characters in
>different ways on different platforms. That makes binary mode required.
>
>I still think we should enforce what we need in our code instead of relying
>on users to get it right. Most of the problems I've seen people have go
>away when they open the files properly. Opening files with just "r" or "w"
>works properly most of the time, but on occasion doesn't (when the file
>winds up containing embedded CR or LF characters).
I would argue that if you data has odd newline conventions and you care,
then you know about binary mode - otherwise you get what you paid for... 8-)
Yes, the newline handling in the csv module is "lumpy" - but that's
because it's a difficult problem (a non-existent spec, and almost infinite
variety in implementations): there is never going to be a single right
answer.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Csv
mailing list