]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-71587: Drop local reference cache to `_strptime` module in `_datetime`...
authorneonene <53406459+neonene@users.noreply.github.com>
Thu, 13 Jun 2024 18:47:46 +0000 (03:47 +0900)
committerGitHub <noreply@github.com>
Thu, 13 Jun 2024 18:47:46 +0000 (12:47 -0600)
commit7719eefcce1c204a37c455d140d840d34a5c8f19
tree950beedea3d7b05167473191b4791ae80e3a32d5
parenteff055340f55d54f334e4b3dab01828b67319b43
[3.12] gh-71587: Drop local reference cache to `_strptime` module in `_datetime` (gh-120431)

The _strptime module object was cached in a static local variable (in the datetime.strptime() implementation).  That's a problem when it crosses isolation boundaries, such as reinitializing the runtme or between interpreters.  This change fixes the problem by dropping the static variable, instead always relying on the normal sys.modules cache (via PyImport_Import()).

(cherry picked from commit 127c1d2771749853e287632c086b6054212bf12a, AKA gh-120224)
Misc/NEWS.d/next/Library/2024-06-07-11-23-31.gh-issue-71587.IjFajE.rst [new file with mode: 0644]
Modules/_datetimemodule.c
Tools/c-analyzer/cpython/globals-to-fix.tsv