Irit Katriel <[email protected]> added the comment:
This is still the same in 3.11:
>>> import pickle
>>> class CustomException(Exception):
... def __init__(self, arg1, arg2):
... msg = "Custom message {} {}".format(arg1, arg2)
... super().__init__(msg)
...
>>> obj_dump = pickle.dumps(CustomException("arg1", "arg2"))
>>> obj = pickle.loads(obj_dump)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: CustomException.__init__() missing 1 required positional argument:
'arg2'
>>>
----------
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32696>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com