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-71587: Drop local reference cache to _strptime module in _datetime (GH-120224) #120431

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

neonene
Copy link
Contributor

@neonene neonene commented Jun 12, 2024

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 127c1d2, AKA gh-120224)

@neonene
Copy link
Contributor Author

neonene commented Jun 12, 2024

Test not included, as the test_embed case requires the following changes:

  1. [3.12]: gh-113055: Use pointer for interp->obmalloc state #118618

  2. The rollback to the reference count management for interned strings
    Interned strings are immortal, despite what the documentation says #113993

auto-merge was automatically disabled June 12, 2024 20:23

Head branch was pushed to by a user without write access

@neonene
Copy link
Contributor Author

neonene commented Jun 12, 2024

This now avoids ABI changes. I'm not sure #118618 (comment) can be applied here.

I'm fine with this.

@ericsnowcurrently ericsnowcurrently merged commit 7719eef into python:3.12 Jun 13, 2024
27 checks passed
@neonene neonene deleted the strptime312 branch June 13, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants