From: tim_one at email.msn.com (Tim Peters)
Date: Fri, 23 Apr 1999 04:12:48 GMT
Subject: unpickling an NT object in Solaris?
In-Reply-To: <dozier-2204990925020001@client-151-200-124-21.bellatlantic.net>
References: <dozier-2204990925020001@client-151-200-124-21.bellatlantic.net>
Message-ID: <000201be8d3f$8d3269e0$9a9e2299@tim>
X-UID: 628                                                  

[Bill Dozier]
> The text mode of pickling is not cross-platform and seems to
> expect UNIX linefeeds. :P

[Guido]
> Nonsense.  However you must open the file you're pickling to in binary
> mode: open(filename,'wb').

[Bill]
> Unfortunately, this detail is not found in the documentation. It
> certainly does not seem obvious that one should write a text file
> in binary mode.

It does if you've tried to port any other kind of text file from Windows to
Unix, whether via Python or C -- there's nothing unique to pickle in this!
Windows text files aren't properly read by Unix libc file routines, and
that's all there is to it.

text-files-aren't-portable-period-ly y'rs  - tim






