Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Say we have an AttributeError with some fields on it (like name). When we pickle and unpickle it, we can see that .name (at least) is lost (and set to None). Optimally those fields should still be in-tact on the unpickled instance.
C:\Users\csm10495\Desktop>pythonPython 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import pickle>>> a = AttributeError("test text", name="test name", obj="test obj")>>> a.name'test name'>>> pickle.loads(pickle.dumps(a)).name>>> pickle.loads(pickle.dumps(a))AttributeError('test text')Your environment
C:\Users\csm10495\Desktop>python --versionPython 3.11.0C:\Users\csm10495\Desktop>verMicrosoft Windows [Version 10.0.19045.2364]C:\Users\csm10495\Desktop>Same thing seems to happen on 3.10.7 and 3.11.3 as well.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done