Skip to content

gh-116946: fully implement GC protocol for _curses_panel.panel - #138333

Merged
picnixz merged 8 commits into
python:mainfrom
picnixz:fix/gc/curses-heap-types-116946
Sep 3, 2025
Merged

gh-116946: fully implement GC protocol for _curses_panel.panel#138333
picnixz merged 8 commits into
python:mainfrom
picnixz:fix/gc/curses-heap-types-116946

Conversation

@picnixz

@picnixzpicnixz commented Sep 1, 2025

Copy link
Copy Markdown
Member

This type is a true container type and thus needs the GC.

Comment threadModules/_curses_panel.c
@picnixz
picnixz marked this pull request as draft September 1, 2025 18:55
@picnixz
picnixz marked this pull request as ready for review September 2, 2025 10:24
Comment threadModules/_curses_panel.c Outdated
Comment threadModules/_curses_panel.c Outdated
Comment threadModules/_curses_panel.c Outdated
Comment threadModules/_curses_panel.c
Comment threadModules/_curses_panel.c Outdated

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@serhiy-storchaka

Copy link
Copy Markdown
Member

This fixes possible reference loops via panel.set_userptr(). So, I think it is worth to backport it.

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@picnixz
picnixz merged commit 572df47 into python:mainSep 3, 2025
51 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@picnixz
picnixz deleted the fix/gc/curses-heap-types-116946 branch September 3, 2025 08:17
@miss-islington-app

Copy link
Copy Markdown

Sorry, @picnixz, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 572df47840d910b9fc9cd951074232ae89442be1 3.14

@miss-islington-app

Copy link
Copy Markdown

Sorry, @picnixz, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 572df47840d910b9fc9cd951074232ae89442be1 3.13

picnixz added a commit to picnixz/cpython that referenced this pull request Sep 3, 2025
…l.panel` (pythonGH-138333)
This commit fixes possible reference loops via `panel.set_userptr`
by implementing `tp_clear` and `tp_traverse` for panel objects.
(cherry picked from commit 572df47)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-138427 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Sep 3, 2025
picnixz added a commit to picnixz/cpython that referenced this pull request Sep 3, 2025
…l.panel` (pythonGH-138333)
This commit fixes possible reference loops via `panel.set_userptr`
by implementing `tp_clear` and `tp_traverse` for panel objects.
(cherry picked from commit 572df47)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

GH-138428 is a backport of this pull request to the 3.13 branch.

@bedevere-app

Copy link
Copy Markdown

GH-138428 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Sep 3, 2025
picnixz added a commit that referenced this pull request Sep 6, 2025
…l` (GH-138333) (#138428)
[3.14] gh-116946: fully implement GC protocol for `_curses_panel.panel` (GH-138333)
This commit fixes possible reference loops via `panel.set_userptr`
by implementing `tp_clear` and `tp_traverse` for panel objects.
(cherry picked from commit 572df47)
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
lkollar pushed a commit to lkollar/cpython that referenced this pull request Sep 9, 2025
python#138333)
This commit fixes possible reference loops via `panel.set_userptr`
by implementing `tp_clear` and `tp_traverse` for panel objects.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@picnixz@serhiy-storchaka@vstinner@RatStar811