[Tutor] problem with pickle using binary mode - re-submission (was problems with pickle)

Michael Janssen Janssen@rz.uni-frankfurt.de
Sun Mar 23 04:50:02 2003


On Sat, 22 Mar 2003, Tony Cappellini wrote:

>
>
> I keep getting EOFError when I open a file  that i saved using pickle.
>
> It turns out that if  use binary mode when I pickle the file, I get the EOF
> error when loading it back in.
> However, if i use text mode, I don' tave this problem.
>
> The file is less than 1000 bytes.
>
> I'm running Windows 2000, and Python 2.2.2

on Windows you must open the file in "binary" mode:
"rb" and "wb"

other wise the OS will turn the newline-or-whatsever into
whatsever-else-i-have-forgotten. Socalled "binary" mode for "file/ open"
builtin surpresses this implicit newline conversion.

Michel
>
> Is this a known issue with binary mode, or am I doing something wrong ?
>
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>