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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to