By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,768 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,768 IT Pros & Developers. It's quick & easy.

KeyError in pickle

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
christof wrote:
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
Jun 27 '08 #2

P: n/a
On 23 Mai, 10:48, Peter Otten <__pete...@web.dewrote:
christof wrote:
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
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
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.