Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-114763: Protect lazy loading modules from attribute access races (GH-114781) #115870

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 24, 2024

Setting the class attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.
(cherry picked from commit 200271c)

Co-authored-by: Chris Markiewicz [email protected]

…aces (pythonGH-114781)

Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.
(cherry picked from commit 200271c)

Co-authored-by: Chris Markiewicz <[email protected]>
@brettcannon brettcannon enabled auto-merge (squash) February 24, 2024 00:03
@brettcannon brettcannon self-assigned this Feb 24, 2024
@brettcannon brettcannon merged commit 7b91b90 into python:3.12 Feb 26, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants