EOF error
Peter Otten
__peter__ at web.de
Sat Dec 3 09:36:12 EST 2005
ash wrote:
> hi,
> when i try to unpickle a pickled file in binary format, i get this
> error:
>
> E:\mdi>test.py
> Traceback (most recent call last):
> File "E:\mdi\qp.py", line 458, in OnReadButton
> data=p.load(file("ques.dat","r"))
> EOFError
>
> what is the reason? how do i overcome this?
> Thanks in advance for you valuable time
You have to open your file in binary mode for both dumping and loading the
data. For that just add a "b" to the mode parameter, e. g.
file("ques.dat", "rb").
Peter
More information about the Python-list
mailing list