Title: tkinter: `setvar()` passes `AsObj`'s NULL to Tcl when the value's `__str__` raises · Issue #161388 · python/cpython · GitHub
Open Graph Title: tkinter: `setvar()` passes `AsObj`'s NULL to Tcl when the value's `__str__` raises · Issue #161388 · python/cpython
X Title: tkinter: `setvar()` passes `AsObj`'s NULL to Tcl when the value's `__str__` raises · Issue #161388 · python/cpython
Description: Bug report Summary setvar() with three arguments crashes the interpreter with SIGSEGV if the value's __str__ raises. Expected: the exception from __str__ should propagate, as it does from setvar(name, value). Reproducer import tkinter cl...
Open Graph Description: Bug report Summary setvar() with three arguments crashes the interpreter with SIGSEGV if the value's __str__ raises. Expected: the exception from __str__ should propagate, as it does from setvar(na...
X Description: Bug report Summary setvar() with three arguments crashes the interpreter with SIGSEGV if the value's __str__ raises. Expected: the exception from __str__ should propagate, as it does from setva...
Opengraph URL: https://github.com/python/cpython/issues/161388
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tkinter: `setvar()` passes `AsObj`'s NULL to Tcl when the value's `__str__` raises","articleBody":"### Bug report\n\n## Summary\n\n`setvar()` with three arguments crashes the interpreter with SIGSEGV if the value's `__str__` raises.\n\nExpected: the exception from `__str__` should propagate, as it does from `setvar(name, value)`.\n\n\n## Reproducer\n\n```python\nimport tkinter\n\nclass StrRaises:\n def __str__(self):\n raise RuntimeError(\"boom\")\n\ntkinter.Tcl().tk.setvar(\"name1\", \"name2\", StrRaises())\n```\n\n```console\nSegmentation fault (core dumped)\n```\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-161397\n* gh-161550\n* gh-161551\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/theosotr","@type":"Person","name":"theosotr"},"datePublished":"2026-11-05T08:13:12Z","url":"https://github.com/python/cpython/issues/161388"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0f1bf90-79dc-9503-4d08-a9a951ab2086 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C824:928E2:34F8609:46985DC:6B02039C |
| html-safe-nonce | fc08659d81e0dedbb369181d9026dec6d528a87c82fe87d3ad89ffb8dac8a8a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODI0OjkyOEUyOjM0Rjg2MDk6NDY5ODVEQzo2QjAyMDM5QyIsInZpc2l0b3JfaWQiOiI0NTc5ODQ0MjI3OTA2Nzk4NDkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c5339659e0e0f6c85b0005bb15f69aac98a182015cf5e31cbbea46ec019db72d |
| hovercard-subject-tag | issue:6219375182 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/161388/issue_layout |
| twitter:image | https://opengraph.githubassets.com/adb0f53897bcfe3972118887a5365b82450616437994e3f10472559d5078eb79/python/cpython/issues/161388 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/adb0f53897bcfe3972118887a5365b82450616437994e3f10472559d5078eb79/python/cpython/issues/161388 |
| og:image:alt | Bug report Summary setvar() with three arguments crashes the interpreter with SIGSEGV if the value's __str__ raises. Expected: the exception from __str__ should propagate, as it does from setvar(na... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theosotr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width