Closed
Description
Bug report
Run the following code:
import enum
import pickle
class PxdEnum(enum.IntFlag):
RANK_0 = 11
RANK_1 = 37
RANK_2 = 389
print(pickle.loads(pickle.dumps(PxdEnum.RANK_2)))
On Python 3.10.10 I get PxdEnum.RANK_2
On Python 3.11.2 I get 389
(which is probably also acceptable)
On Python 3.12 (0aaef83351473e8f4eb774f8f999bbe87a4866d7) I get
Traceback (most recent call last):
File "<path>/enumpickle.py", line 9, in <module>
print(pickle.loads(pickle.dumps(PxdEnum.RANK_2)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for |: 'PxdEnum' and 'NoneType'
Your environment
Tested as described on Python 3.10, 3.11, and 3.12.
Linux