-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Closed
Copy link
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error