]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-125243: Fix ZoneInfo data race in free threading build (#125281)
authorSam Gross <colesbury@gmail.com>
Sun, 13 Oct 2024 20:17:51 +0000 (16:17 -0400)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 20:17:51 +0000 (16:17 -0400)
commitf1d33dbddd3496b062e1fbe024fb6d7b023a35f5
tree0cbdb49dc8a990a0c656e61d338906200fa19811
parentcb8e5995d89d9b90e83cf43310ec50e177484e70
gh-125243: Fix ZoneInfo data race in free threading build (#125281)

Lock `ZoneInfoType` to protect accesses to `ZONEINFO_STRONG_CACHE`.
Refactor the `tp_new` handler to use Argument Clinic so that we can just
use `@critical_section` annotations on the relevant functions.

Also use `PyDict_SetDefaultRef` instead of `PyDict_SetDefault` when
inserting into the `TIMEDELTA_CACHE`.
Misc/NEWS.d/next/Library/2024-10-10-20-39-57.gh-issue-125243.eUbbtu.rst [new file with mode: 0644]
Modules/_zoneinfo.c
Modules/clinic/_zoneinfo.c.h