]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-71587: Drop local reference cache to `_strptime` module in `_datetime` (gh-120224)
authorneonene <53406459+neonene@users.noreply.github.com>
Wed, 12 Jun 2024 16:46:39 +0000 (01:46 +0900)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2024 16:46:39 +0000 (10:46 -0600)
commit127c1d2771749853e287632c086b6054212bf12a
treef036cf29942269141fdc218340e1d6cbbf849c14
parentfabcf6bc8f89f008319442dea614d5cbeb959544
gh-71587: Drop local reference cache to `_strptime` module in `_datetime` (gh-120224)

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()).
Include/internal/pycore_global_objects_fini_generated.h
Include/internal/pycore_global_strings.h
Include/internal/pycore_runtime_init_generated.h
Include/internal/pycore_unicodeobject_generated.h
Lib/test/test_embed.py
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