Message401128
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')` |
|
Date |
User |
Action |
Args |
2021-09-06 10:14:34 | yonghengzero | set | recipients:
+ yonghengzero |
2021-09-06 10:14:34 | yonghengzero | set | messageid: <1630923274.69.0.294387149834.issue45112@roundup.psfhosted.org> |
2021-09-06 10:14:34 | yonghengzero | link | issue45112 messages |
2021-09-06 10:14:34 | yonghengzero | create | |
|