-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-117398: Add multiphase support to _datetime #119373
gh-117398: Add multiphase support to _datetime #119373
Conversation
erlend-aasland
commented
May 22, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Isolate the _datetime extension module #117398
@ericsnowcurrently: this works nice for a single test run, but obviously fails if we're running ref-leak tests (the reload reinitializes the singletons in the global state). |
One way to fix reloading is to use an initialization guard. |
thank you for doing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ericsnowcurrently @erlend-aasland Are we sure this won't segfault in the case I described in #117398 (comment) ? (acquire a capsule reference, reload the module, use the capsule with the reloaded module) The addition of the |
This is an incomplete first step of a series of multiple PRs. Eric and I propose to handle the encapsulated C API last. The scenario you describe will probably segfault for now. |
FTR, the test guard was added because running with |
Actually, the scenario you are describing is what happens when you do a ref-leak run of the C API test: the |
This comment was marked as outdated.
This comment was marked as outdated.
This is minimal support. Subinterpreters are not supported yet. That will be addressed in a later change. (cherry picked from commit 3e8b609) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
GH-119636 is a backport of this pull request to the 3.13 branch. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
…ythongh-119373) (pythongh-119636)" This reverts commit d58ebf0.
|
|
|
|
This change introduced a reference leak: see issue gh-119655. |
This is minimal support. Subinterpreters are not supported yet. That will be addressed in a later change. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>