From: Filipe on
I'm with a problem I'm doing a program in python, it sends the
following error message:

File "C:/Documents and Settings/Filipe Vinicius/Desktop/Filipe/Cefet/
LP/Python/trab.sistema.academico/sistemaacademico.2010.5.23.c.py",
line 40, in administrador
lp = pickle.load(f)
File "D:\Arquivos De Programa\Python31\lib\pickle.py", line 1365, in
load
encoding=encoding, errors=errors).load()
EOFError

What you need to do to repair this error? in my program at the part
where the error is find is that:

def administrador():
f = open('professores.dat', 'rb')
lp = pickle.load(f)
f.close()
...

Note: i had already imported the pikcle library
THX
From: Gary Herron on
On 05/23/2010 08:13 AM, Filipe wrote:
> I'm with a problem I'm doing a program in python, it sends the
> following error message:
>
> File "C:/Documents and Settings/Filipe Vinicius/Desktop/Filipe/Cefet/
> LP/Python/trab.sistema.academico/sistemaacademico.2010.5.23.c.py",
> line 40, in administrador
> lp = pickle.load(f)
> File "D:\Arquivos De Programa\Python31\lib\pickle.py", line 1365, in
> load
> encoding=encoding, errors=errors).load()
> EOFError
>
> What you need to do to repair this error? in my program at the part
> where the error is find is that:
>
> def administrador():
> f = open('professores.dat', 'rb')
> lp = pickle.load(f)
> f.close()
> ...
>
> Note: i had already imported the pikcle library
> THX
>


EOFError means "End Of File". The file you are reading in
'professores.dat' must not contain a valid pickle -- perhaps it is
empty, or created incorrectly. But that's where to look. Show us how
you created that file.

Gary Herron