Re: [Python-Dev] BaseException pickle issue

2007-04-01 Thread Eric Huss
> I think that this is a bug, but removing those methods is not the right > solution. The __reduce__ method is needed because builtin exceptions > don't store their attributes in the __dict__ anymore; if you remove it, > then those attributes will be lost during pickling. The __setstate__ > metho

[Python-Dev] BaseException pickle issue

2007-03-31 Thread Eric Huss
Some subclasses of Exception are no longer pickleable in Python 2.5. An example: class A(Exception): def __init__(self, foo): self.foo = foo The key problem here is if you do not somehow set self.args to the correct arguments (via Exception.__init__ or setting self.args d