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

Python implementation of pickle calls persistent_id() for a persistent id #126489

Closed
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error
@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

Pickle allows to define thepersistent_id() method in thePickler class. If it is defined, it is called for every pickled object, and its result will be pickled instead if it is not None. In the Python implementationpersistent_id() is also called for the result ofpersistent_id(), but the result of the second call is ignored. The C implementation only callspersistent_id() once. Calling it twice is just a waste of time in best case, and can have other negative impact (for example if reference for every object for which it was called is stored), so I consider it a bug.

It was found during work on#125752.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp