Skip to content

gh-161388: [tkinter] Fix crash on raising __str__ method passed to setvar - #161397

Merged
sobolevn merged 6 commits into
python:mainfrom
sobolevn:issue-161388
Nov 7, 2026
Merged

sobolevn merged 6 commits into
python:mainfrom
sobolevn:issue-161388

Conversation

@sobolevn

@sobolevn sobolevn commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Comment thread Modules/_tkinter.c Resolved
Comment thread Modules/_tkinter.c Resolved
Comment thread Modules/_tkinter.c Resolved
Comment thread Modules/_tkinter.c Resolved
@sobolevn
sobolevn enabled auto-merge (squash) November 5, 2026 19:55
@sobolevn sobolevn added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 5, 2026
Comment thread Lib/test/test_tcl.py Resolved
@serhiy-storchaka

Copy link
Copy Markdown
Member

The fix LGTM, I have comments for tests and NEWS.

@sobolevn
sobolevn disabled auto-merge November 5, 2026 20:08
Comment thread Lib/test/test_tcl.py Resolved
Comment thread Lib/test/test_tcl.py Resolved
Comment thread Lib/test/test_tcl.py Resolved

@serhiy-storchaka serhiy-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.

If tk.setvar("name1", value) was set a Tcl variable, tk.getvar("name1", "name2") will fail for other reason. It is safer to use different names in all four cases, and check read immediately after an attempted write.

@serhiy-storchaka serhiy-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.

Thank you. LGTM. 👍

@sobolevn
sobolevn enabled auto-merge (squash) November 7, 2026 10:10
@sobolevn

sobolevn commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Thank you for the reviews! 👍

@sobolevn
sobolevn merged commit 6026791 into python:main Nov 7, 2026
96 of 98 checks passed
@miss-islington-app

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

Sorry, @sobolevn, I could not cleanly backport this to 3.15 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 6026791c977a1df2ff8a427aad294388992ae078 3.15

@miss-islington-app

Copy link
Copy Markdown

Sorry, @sobolevn, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 6026791c977a1df2ff8a427aad294388992ae078 3.14

@bedevere-app

bedevere-app Bot commented Nov 7, 2026

Copy link
Copy Markdown

GH-161550 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 7, 2026
@bedevere-app

bedevere-app Bot commented Nov 7, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 7, 2026
sobolevn added a commit that referenced this pull request Nov 7, 2026
…sed to `setvar` (GH-161397) (#161550)

(cherry picked from commit 6026791)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants