Help: pickle module unable to load "rb" mode files in linux

Peter Otten __peter__ at web.de
Tue Apr 2 11:20:19 EDT 2013


Surya Kasturi wrote:

> Hi, hope you can help me on it..
> 
> with open(pickle_f, 'r') as fhand:
>         obj = pickle.load(fhand)
> 
> 
> This works on linux but not in windows until  I use "rb" mode while
> creating file object. Surprisingly, the "rb" mode is not working on
> Linux.. raising EOFError.
> 
> Why is this happening?

I don't know.

Please give a complete self-contained example that uses "wb" to write the 
file and "rb" to read it, and that fails on Linux. Don't forget to tell us 
the version of Python you used to run that script.




More information about the Python-list mailing list