Skip to content

gh-132413: Clear weakref to _datetime after modules are finalized - #136152

Closed
neonene wants to merge 13 commits into
python:mainfrom
neonene:wr-132413
Closed

gh-132413: Clear weakref to _datetime after modules are finalized#136152
neonene wants to merge 13 commits into
python:mainfrom
neonene:wr-132413

Conversation

@neonene

@neonene neonene commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

The _datetime module has a weakref to the module itself, which is expected to be connected all its life. However, finalize_remove_modules() in pylifecycle.c shares the same weakref, then the GC clears it before finishing the module.

The module should be cleared first, bypassing the GC once.

@neonene
neonene marked this pull request as ready for review July 1, 2025 20:00
@neonene

neonene commented Jul 1, 2025

Copy link
Copy Markdown
Contributor Author

A fundamental fix seems to be comming.

@neonene
neonene marked this pull request as draft July 2, 2025 18:54
@neonene neonene closed this Jul 9, 2025
@neonene neonene reopened this Aug 10, 2025
@neonene
neonene changed the base branch from main to 3.14 August 10, 2025 21:41
@neonene
neonene changed the base branch from 3.14 to main August 10, 2025 21:43
@neonene
neonene changed the base branch from main to 3.14 August 10, 2025 21:46
@neonene
neonene changed the base branch from 3.14 to main August 10, 2025 21:47
@neonene neonene closed this Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant