-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Pickle allows to define the persistent_id()
method in the Pickler
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 implementation persistent_id()
is also called for the result of persistent_id()
, but the result of the second call is ignored. The C implementation only calls persistent_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
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done