diff options
author | Chris Markiewicz <effigies@gmail.com> | 2024-02-24 00:02:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-24 00:02:16 (GMT) |
commit | 200271c61db44d90759f8a8934949aefd72d5724 (patch) | |
tree | 9fddf73bc8d17f6d71c8ac26591911c98a445a9c /Misc | |
parent | ef6074b352a95706f44a592ffe31baace690cc1c (diff) | |
download | cpython-200271c61db44d90759f8a8934949aefd72d5724.zip cpython-200271c61db44d90759f8a8934949aefd72d5724.tar.gz cpython-200271c61db44d90759f8a8934949aefd72d5724.tar.bz2 |
gh-114763: Protect lazy loading modules from attribute access races (GH-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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2024-01-30-23-28-29.gh-issue-114763.BRjKkg.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-01-30-23-28-29.gh-issue-114763.BRjKkg.rst b/Misc/NEWS.d/next/Library/2024-01-30-23-28-29.gh-issue-114763.BRjKkg.rst new file mode 100644 index 0000000..e8bdb83 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-01-30-23-28-29.gh-issue-114763.BRjKkg.rst @@ -0,0 +1,3 @@ +Protect modules loaded with :class:`importlib.util.LazyLoader` from race +conditions when multiple threads try to access attributes before the loading +is complete. |