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 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.
-
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 theTcl_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 initializingv->BooleanType
fromTkapp_New()
rather than lazily initializingtkapp->BooleanType
fromFromObj()
. -
TIP 568: As of Tcl 9.0, "bytearray" is unregistered; the suggested idiom can be used instead.
-
TIP 484: 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 theTcl_ObjType *
of "int" from a value created usingTcl_NewIntObj(0)
and of "wideInt" (if present) using e.g.Tcl_NewWideIntObj((Tcl_WideInt)(1) << 32)
. However it would not be appropriate forFromObj()
to continue usingTcl_GetLongFromObj()
whenlong
is 32-bit, as that would retrieve an overflowed result for values within (LONG_MAX
,ULONG_MAX
] rather than forceFromObj()
to try again withTcl_GetWideIntFromObj()
(viafromWideIntObj()
); an alternative would be to always useTcl_GetWideIntFromObj()
for both "int" and "wideInt" values.
I 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.