]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-123431: Harmonize extension code checks in pickle (GH-123434) (#123459)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Sep 2024 11:17:16 +0000 (13:17 +0200)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2024 11:17:16 +0000 (13:17 +0200)
commitab29053784c678f003d832bbf9fa4ca7b63db623
tree684690f0996ba9dcce970188f6610c2d29ca5b0f
parent5c408e333dce102fbe71725a43d7dec5e6798928
[3.13] gh-123431: Harmonize extension code checks in pickle (GH-123434) (#123459)

gh-123431: Harmonize extension code checks in pickle (GH-123434)

This checks are redundant in normal circumstances and can only work if
the extension registry was intentionally broken.

* The Python implementation now raises exception for the extension code
  with false boolean value.
* Simplify the C code. RuntimeError is now raised in explicit checks.
* Add many tests.
(cherry picked from commit 0c3ea3023878f5ad5ca4680d5510da1fe208cbfa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/pickle.py
Lib/test/pickletester.py
Modules/_pickle.c