[Tim Peters]
>>Yes: regardless of platform, always open files used for pickles
>> in binary mode. ...
[John Machin]
> Tim, the manual as of version 2.4 does _not_ mention the need
> to use 'b' on OSes where it makes a difference, not even in the
> examples at the end of the chapter. Further, it s
On Fri, 14 Jan 2005 09:12:49 -0500, Tim Peters <[EMAIL PROTECTED]>
wrote:
>[Aki Niimura]
>> I started to use pickle to store the latest user settings for the tool
>> I wrote. It writes out a pickled text file when it terminates and it
>> restores the settings when it starts.
>...
>> I guess DOS te
Irmen de Jong wrote:
> Tim Peters wrote:
>
> > Yes: regardless of platform, always open files used for pickles in
> > binary mode. That is, pass "rb" to open() when reading a pickle
file,
> > and "wb" to open() when writing a pickle file. Then your pickle
files
> > will work unchanged on all pla
[Irmen de Jong]
> I've been wondering why there even is the choice between binary mode
> and text mode. Why can't we just do away with the 'text mode' ?
> What does it do, anyways? At least, if it does something, I'm sure
> that it isn't something that can be done in Python itself if
> really requi
Tim Peters wrote:
Yes: regardless of platform, always open files used for pickles in
binary mode. That is, pass "rb" to open() when reading a pickle file,
and "wb" to open() when writing a pickle file. Then your pickle files
will work unchanged on all platforms. The same is true of files
contai
[Aki Niimura]
> I started to use pickle to store the latest user settings for the tool
> I wrote. It writes out a pickled text file when it terminates and it
> restores the settings when it starts.
...
> I guess DOS text format is creating this problem.
Yes.
> My question is "Is there any elegant
Open the file on windows for writing with "wb" mode, the b is for binary.
--
http://mail.python.org/mailman/listinfo/python-list