[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__
report at bugs.python.org
Wed Jun 30 05:04:14 CEST 2010
Eric Huss <eric at huss.org> added the comment:
Alexander, the use case I was involved with was an RPC system which allowed exceptions to propagate over the connection. In this case, you do not have absolute control over which exceptions may be raised, or who wrote the code that is raising the exception. There are many cases, even in the standard library, where people do not pass all arguments to the base exception class. Some of these are probably mistakes, but in general pickle shouldn't fail on otherwise legitimate objects.
There are other cases where passing all arguments up is not wanted, or at least cumbersome. If you have multiple levels of inheritance, and subclasses add additional arguments to the init, they wouldn't have a way to include those arguments to the base class unless all classes were written with *args in the init function, which many people would not know or remember to do.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list