Skip to content

[3.8] bpo-41993: Fix possible issues in remove_module() (GH-22631)#22649

Closed
serhiy-storchaka wants to merge 1 commit into
python:3.8from
serhiy-storchaka:backport-8287aad-3.8
Closed

[3.8] bpo-41993: Fix possible issues in remove_module() (GH-22631)#22649
serhiy-storchaka wants to merge 1 commit into
python:3.8from
serhiy-storchaka:backport-8287aad-3.8

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Oct 11, 2020

Copy link
Copy Markdown
Member
  • 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 8287aad)

https://bugs.python.org/issue41993

* 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 8287aad)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants