Re: Exception classes don't follow pickle protocol, problems unpickling

2009-12-08 Thread Irmen de Jong
On 7-12-2009 10:12, Peter Otten wrote: So there are 2 problems: the pickle protocol isn't used when exception objects (or instances of classes derived from Exception) are pickled, and during unpickling, it then crashes because it calls __init__ with the wrong amount of parameters. (why is it bo

Re: Exception classes don't follow pickle protocol, problems unpickling

2009-12-07 Thread Peter Otten
Irmen de Jong wrote: > I am puzzled why Python's exception classes don't seem to follow the > pickle protocol. To be more specific: an instance of a user defined > exception, subclassed from Exception, cannot be pickled/unpickled > correctly in the expected way. > > The pickle protocol says that:

Exception classes don't follow pickle protocol, problems unpickling

2009-12-06 Thread Irmen de Jong
Hi, I am puzzled why Python's exception classes don't seem to follow the pickle protocol. To be more specific: an instance of a user defined exception, subclassed from Exception, cannot be pickled/unpickled correctly in the expected way. The pickle protocol says that: __getinitargs__ is used