[Python-Dev] Pickling problems are hard to debug (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 26 03:13:22 CEST 2006
- Previous message: [Python-Dev] Another PEP 343 contextmanager glitch
- Next message: [Python-Dev] Pickling problems are hard to debug
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
There seems to be a need for better diagnostics when pickle encounters something that can't be pickled.
Recently when attempting to pickle a rather large and complicated data structure, I got the following incomprehensible message:
cPickle.PicklingError: args[0] from newobj args has the wrong class
Trying again with protocol 1 instead of 2, I get
TypeError: can't pickle function objects
which I'm guessing is because somewhere I've tried to pickle a nested function or a bound method. But it still doesn't give me any idea which function I tried to pickle or where abouts it turns up in the data structure.
Anyone have any ideas how the situation could be improved? At the very least, it could include some info about the type and identity of the offending object.
Greg
- Previous message: [Python-Dev] Another PEP 343 contextmanager glitch
- Next message: [Python-Dev] Pickling problems are hard to debug
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]