Skip to content

[3.13] GH-91636: Clear weakrefs created by finalizers. (GH-136401) - #144214

Merged
ambv merged 4 commits into
python:3.13from
sergey-miryanov:backport-b6b99bf-3.13
Mar 23, 2026
Merged

[3.13] GH-91636: Clear weakrefs created by finalizers. (GH-136401)#144214
ambv merged 4 commits into
python:3.13from
sergey-miryanov:backport-b6b99bf-3.13

Conversation

@sergey-miryanov

@sergey-miryanovsergey-miryanov commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Weakrefs to unreachable garbage that are created during running of finalizers need to be cleared. This avoids exposing objects that have tp_clear called on them to Python-level code. (cherry picked from commit b6b99bf)

…H-136401)
Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared. This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
(cherry picked from commit b6b99bf)
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
@gpshead

Copy link
Copy Markdown
Member

I think this needs re-applying to 3.14 if we're going to do it for 3.13. it was removed (likely temporarily) from 3.14 as a risk mitigation for 3.14.1 (see issue and prs)

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

I understand. At least we have "working" PR for backporting if we decide so :)

@vstinner

Copy link
Copy Markdown
Member

I think this needs re-applying to 3.14 if we're going to do it for 3.13. it was removed (likely temporarily) from 3.14 as a risk mitigation for 3.14.1 (see issue and prs)

What's the status of this change? Did it land in 3.14 again or not?

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

@hugovk@Yhg1s Should we merge this since 3.14 backport was merged?

@vstinner

Copy link
Copy Markdown
Member

The 3.14 change is #144444?

@sergey-miryanov

Copy link
Copy Markdown
ContributorAuthor

@vstinner Yes.

@ambv
ambv merged commit eda53e6 into python:3.13Mar 23, 2026
42 checks passed
Sign up for freeto 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.

5 participants

@sergey-miryanov@gpshead@vstinner@StanFromIreland@ambv