This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author iritkatriel
Recipients iritkatriel, yonghengzero
Date 2021-09-06.13:08:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630933683.82.0.057014853624.issue45112@roundup.psfhosted.org>
In-reply-to
Content
The default __reduce__ method of Exception returns the arg you pass to the Exception constructor:

>>> a = ExcA("a banana")
>>> a.__reduce__()
(<class '__main__.ExcA'>, ('missing a banana',))
>>> 


This is then pickled, and when unpickled the arg is passed to the ExcA constructor. 

If you want to change this, you can implement __reduce__ on ExcA o return just the part you want it to return.
History
Date User Action Args
2021-09-06 13:08:03iritkatrielsetrecipients: + iritkatriel, yonghengzero
2021-09-06 13:08:03iritkatrielsetmessageid: <1630933683.82.0.057014853624.issue45112@roundup.psfhosted.org>
2021-09-06 13:08:03iritkatriellinkissue45112 messages
2021-09-06 13:08:03iritkatrielcreate