Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

enum.IntFlag (un)pickles incorrectly on Python 3.12 (and differently on Python 3.11) #105332

Closed
Assignees
ethanfurman
Labels
3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@da-woods

Description

@da-woods

Bug report

Run the following code:

import enumimport pickleclass PxdEnum(enum.IntFlag):    RANK_0 = 11    RANK_1 = 37    RANK_2 = 389print(pickle.loads(pickle.dumps(PxdEnum.RANK_2)))

On Python 3.10.10 I getPxdEnum.RANK_2
On Python 3.11.2 I get389 (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 fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp