KeyError in pickle

C

christof

Hi,

I am using pickle/unpickle to let my program save its documents to
disk. While this it worked stable for a long time, one of my users now
complained, that he had a file which can't be loaded.

The traceback is:

File "pickle.pyo", line 1374, in loads
File "pickle.pyo", line 858, in load
KeyError: 'A'


Does anybody know this problem. How this can happen and how can I
avoid it?

Thanks,
Christof
 
P

Peter Otten

christof said:
I am using pickle/unpickle to let my program save its documents to
disk. While this it worked stable for a long time, one of my users now
complained, that he had a file which can't be loaded.

The traceback is:

File "pickle.pyo", line 1374, in loads
File "pickle.pyo", line 858, in load
KeyError: 'A'


Does anybody know this problem. How this can happen and how can I
avoid it?

Is this reproducible? How? If not I would guess that the file is corrupted.

Peter
 
C

christof

Is this reproducible? How? If not I would guess that the file is corrupted.

Peter

I found the problem: the user did a text export and gave the exported
file the wrong extension. So: the file was not valid python pickle. I
should add a type signature to fhe file format to avoid this.

Thanks anyway,
Christof
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top