Title: Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types · Issue #103194 · python/cpython · GitHub
Open Graph Title: Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types · Issue #103194 · python/cpython
X Title: Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types · Issue #103194 · python/cpython
Description: Bug report I recently made changes to Tcl.pm (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (gisle/tcl.pm#42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly AsObj() and FromObj()). Although I have not...
Open Graph Description: Bug report I recently made changes to Tcl.pm (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (gisle/tcl.pm#42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly AsO...
X Description: Bug report I recently made changes to Tcl.pm (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (gisle/tcl.pm#42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly AsO...
Opengraph URL: https://github.com/python/cpython/issues/103194
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types","articleBody":"# Bug report\r\nI recently made changes to [Tcl.pm](http://tcl.pm/) (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (https://github.com/gisle/tcl.pm/pull/42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly `AsObj()` and `FromObj()`). Although I have not attempted to run Tkinter with Tcl 8.7/9.0, I do notice a few issues in the code which would need to be addressed first.\r\n\r\n* Tcl 9.0 currently renames the Tcl 8.5 \"booleanString\" value type to \"boolean\", which will break the existing check in `FromObj()`. Tcl has suggested an idiom for retrieving the `Tcl_ObjType *` of unregistered types like \"booleanString\", regardless of Tcl version (see https://core.tcl-lang.org/tcl/info/3bb3bcf2da5b); although I would think that approach entails initializing `v-\u003eBooleanType` from `Tkapp_New()` rather than lazily initializing `tkapp-\u003eBooleanType` from `FromObj()`.\r\n\r\n* [TIP 568](https://core.tcl-lang.org/tips/doc/trunk/tip/568.md): As of Tcl 9.0, \"bytearray\" is unregistered; the suggested idiom can be used instead.\r\n\r\n* [TIP 484](https://core.tcl-lang.org/tips/doc/trunk/tip/484.md): As of Tcl 8.7, on platforms with 32-bit `long`, there are no longer separate 32-bit \"int\" and 64-bit \"wideInt\" value types; there is only a single 64-bit type. And as of Tcl 9.0, the \"int\" type is unregistered. It is possible to reliably get the `Tcl_ObjType *` of \"int\" from a value created using `Tcl_NewIntObj(0)` and of \"wideInt\" (if present) using e.g. `Tcl_NewWideIntObj((Tcl_WideInt)(1) \u003c\u003c 32)`. However it would not be appropriate for `FromObj()` to continue using `Tcl_GetLongFromObj()` when `long` is 32-bit, as that would retrieve an overflowed result for values within \u0026#40;`LONG_MAX`,`ULONG_MAX`\u0026#93; rather than force `FromObj()` to try again with `Tcl_GetWideIntFromObj()` (via `fromWideIntObj()`); an alternative would be to always use `Tcl_GetWideIntFromObj()` for both \"int\" and \"wideInt\" values.\r\n\r\nI am not familiar with contributing to Python, but I may be able to propose fixes for the above issues if no one else already has or intends to. I believe the fixes for the above issues are backward compatible with Tcl 8.5 and 8.6, and so can be implemented and tested without other changes that are likely also needed (such as for Tcl-syntax APIs) before Tkinter is usable with ~~Tcl 8.7/9.0 and Tk 8.7 (which will be compatible with both Tcl 8.7 and 9.0)~~ Tcl and Tk 8.7/9.0.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-103846\r\n* gh-119830\n* gh-119831\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/chrstphrchvz","@type":"Person","name":"chrstphrchvz"},"datePublished":"2023-04-02T16:56:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/103194/cpython/issues/103194"}
| 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:94be3b80-6504-0682-d9e6-2fd14270d176 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB68:DF9A5:3876CB:503A27:696A4473 |
| html-safe-nonce | 330f1d9e63a16693a522e2765a75a421c6b6832de4fdd86dee615d29e86f5d57 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjY4OkRGOUE1OjM4NzZDQjo1MDNBMjc6Njk2QTQ0NzMiLCJ2aXNpdG9yX2lkIjoiMTE5NDY0NTk2Njg5OTc5MDk2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 078494b943587bd2fc94dc2ffe8c0b0c11f01d3a87e6373d5095069ae6d3fd07 |
| hovercard-subject-tag | issue:1651018652 |
| 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/103194/issue_layout |
| twitter:image | https://opengraph.githubassets.com/190023b2a42892899b05a9ea2285fb63a07c3105f44586cff23e104f24fb4410/python/cpython/issues/103194 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/190023b2a42892899b05a9ea2285fb63a07c3105f44586cff23e104f24fb4410/python/cpython/issues/103194 |
| og:image:alt | Bug report I recently made changes to Tcl.pm (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (gisle/tcl.pm#42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly AsO... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chrstphrchvz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| 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 | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width