]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-41993: Fix possible issues in remove_module() (GH-22631) (GH-22647)
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 14 Oct 2020 09:09:44 +0000 (02:09 -0700)
committerGitHub <noreply@github.com>
Wed, 14 Oct 2020 09:09:44 +0000 (12:09 +0300)
commit391a544f2a52673f6630c672e89840fd6ac36723
tree06759ba79e72debd3425d2f0d4111f1bdd60d204
parent881a13cad534cf3fe4474579c22235a15d3ba27b
bpo-41993: Fix possible issues in remove_module() (GH-22631) (GH-22647)

* PyMapping_HasKey() is not safe because it silences all exceptions and can return incorrect result.
* Informative exceptions from PyMapping_DelItem() are overridden with RuntimeError and
  the original exception raised before calling remove_module() is lost.
* There is a race condition between PyMapping_HasKey() and PyMapping_DelItem().
(cherry picked from commit 8287aadb75f6bd0154996424819334cd3839707c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Misc/NEWS.d/next/Core and Builtins/2020-10-10-13-53-52.bpo-41993.YMzixQ.rst [new file with mode: 0644]
Python/import.c