New submission from Chen Zero <yonghengz...@gmail.com>:
Hi, when I'm trying to serialize/deserialize python exception object through pickle, I found that deserialize result is not the same as the original object... My python version is 3.9.1, working os: macOS Big Sur 11.4 Here is minimum reproducing code example: import pickle class ExcA(Exception): def __init__(self, want): msg = "missing " msg += want super().__init__(msg) ExcA('bb') # this will output ExcA("missing bb"), which is good pickle.loads(pickle.dumps(ExcA('bb'))) # this will output ExcA("missing missing bb"), which is different from `ExcA('bb')` ---------- files: screenshot.png messages: 401128 nosy: yonghengzero priority: normal severity: normal status: open title: Python exception object is different after pickle.loads and pickle.dumps type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50262/screenshot.png _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45112> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com