In <[EMAIL PROTECTED]>, Steve Holden
wrote:

> Laurent Laporte wrote:
>
>> I'm using cvs standard module under Python 2.3 / 2.4 to read a CSV
>> file. The file is opened in binary mode, so I keep the end of line
>> terminator.
>> 
> It's not advisable to open a file like a CSV, intended for use as text, 
> in binary mode.

But the docs "demand" this explicitly and all examples in the docs fulfill
that demand.

>From http://docs.python.org/lib/csv-contents.html :

  If csvfile is a file object, it must be opened with the 'b' flag on
  platforms where that makes a difference.

I guess the reason is the same as for "text" pickle format:  If you don't
use binary mode the file is not platform independend anymore because some
OSes "manipulate" the data in text mode.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to