You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pickle.dumps throws an exception when attempted to serialize enum value
>>> pickle.dumps(ValEnum.val1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_pickle.PicklingError: Can't pickle <enum 'ValEnum'>: attribute lookup ValEnum on importlib._bootstrap failed
Code to reproduce the behaviour:
cpdef enum ValEnum:
val1 =1
val2 =2
importpicklepickle.dumps(ValEnum.val1)
Expected behaviour
pickle.dumps should return serialized value instead of throwing an exception
Environment
OS: Linux 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Python version [e.g. 3.10.6]
Cython version [e.g. 3.0.0a11]
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
pickle.dumps throws an exception when attempted to serialize enum value
Code to reproduce the behaviour:
Expected behaviour
pickle.dumps should return serialized value instead of throwing an exception
Environment
OS: Linux 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Python version [e.g. 3.10.6]
Cython version [e.g. 3.0.0a11]
Additional context
No response
The text was updated successfully, but these errors were encountered: