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

cProfile cannot run code that pickles objects defined in __main__ #132737

Closed
Assignees
gaogaotiantian
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@aneeshdurg

Description

@aneeshdurg

Bug report

Bug description:

importpickleimportsysfromdataclassesimportdataclass,field@dataclassclassState:x:list[int]=field(default_factory=list)print(pickle.dumps(State([0])))

The following code will run successfully on it's own, but will fail if run withcProfile, with the message that__main__.State could not be found by.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

stdlibStandard 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