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 rhettinger
Recipients iritkatriel, rhettinger, yonghengzero
Date 2021-09-06.14:28:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630938501.48.0.0192919171208.issue45112@roundup.psfhosted.org>
In-reply-to
Content
Pickling customized subclasses can be tricky.  The essential details are here:  https://docs.python.org/3/library/pickle.html#object.__reduce__

Here's some code to get you started.

class ExcA(Exception):
    def __init__(self, want):
        msg = "missing "
        msg += want
        super().__init__(msg)
    def __reduce__(self):
        return (type(self), self.args, self.args)
    def __setstate__(self, state):
        self.args = stat
History
Date User Action Args
2021-09-06 14:28:21rhettingersetrecipients: + rhettinger, iritkatriel, yonghengzero
2021-09-06 14:28:21rhettingersetmessageid: <1630938501.48.0.0192919171208.issue45112@roundup.psfhosted.org>
2021-09-06 14:28:21rhettingerlinkissue45112 messages
2021-09-06 14:28:21rhettingercreate