-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkinter, IDLE: Future Tcl and Tk can have differing version/patchlevel #104496
Comments
Is there different code to get tk version/patchlevel? |
Tcl version: This issue is likely more applicable to version checks which need to be added (e.g. for issues like #104497) rather than existing ones (since checking for Tcl 8.6 is sufficient for knowing e.g. whether Tk has PNG support). For this issue, I am less inclined to propose a solution on my own without prior input. I hesitate to introduce more ways to retrieve the version/patchlevel. Personally, I try to rely on the Tcl |
https://github.com/python/cpython/blob/48b3617de491f00a3bf978b355074cc8e228d61b/Lib/tkinter/__init__.py#LL1081C1-L1084C1 has the following, which includes all 'patchlevel' occurrences in the file. def info_patchlevel(self): # Method of Misc, a base for toplevel and widgets. [comment added]
"""Returns the exact version of the Tcl library."""
patchlevel = self.tk.call('info', 'patchlevel')
return _parse_version(patchlevel) Is this call, the one that IDLE currently uses, returning the tcl or tk version? |
This always returns the Tcl patchlevel. |
Print both if they are different, as may happen in the future.
Print both if they are different, as may happen in the future.
…04585) Print both if they are different, as may happen in the future.
I am not familiar with tcl in general, just enough to translate tk commands into tkinter. Are the 'package' commands available with the tcl we install with Windows and macOS? |
Yes. |
Seems that On other hand, Python already uses I thought about introducing more ways to retrieve the structured version info, but I hesitate between method |
How so? Section “Version numbers” in the Tcl documentation for the
|
Maybe Tkinter can wait to act on this issue. There is still active disagreement among Tcl/Tk core developers (most recently in https://sourceforge.net/p/tcl/mailman/tcl-core/thread/3deb862a-cc07-4b6f-ae15-1916a998eac2%40Spark/) over the original plan to decouple Tcl and Tk versions and release Tcl 8.7, Tcl 9.0, and Tk 8.7; some of them only want Tcl/Tk 9.0. |
I am sorry, I looked in the 8.4 branch. |
Ah, understandable. The old documentation does tend to show up in search engine results. The |
It is just that I did not checked what branch was checked out in my worktree. I thought it was the latest version, but for some reasons it was 8.4. |
In future Tcl and Tk versions can be desynchronized.
…onGH-107688) In future Tcl and Tk versions can be desynchronized. (cherry picked from commit 3c8e8f3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
pythonGH-107688) In future Tcl and Tk versions can be desynchronized.. (cherry picked from commit 3c8e8f3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Anything left to do here, or can we close the issue? |
I think it is still too early to know what else needs to be done for this issue. I am not aware of any official announcement from Tcl/Tk on what their plan is now, but some of its inner developer circle still insists that Tk 9.0 be released and not Tk 8.7. |
The latest I have heard is that they want to release Tcl 9.0 and Tk 9.0 first, and then Tcl 8.7 and Tk 8.7 either later or not at all. I would still suggest version checks be careful about which of |
Tcl 9.0 will definitely ship before Tcl 8.7 (which is a "maybe, if there's demand great enough and developer effort enough"). Tk is a bit less certain, but there's a bit of head of steam getting up to go to 9.0 there too just so we can delete some really old and nasty undocumented cruft that I truly hope you're not depending on. We test Tcl 9.0 and Tk 8.7 as a combination, as well as Tcl 9.0 and Tk 9.0. We do not test Tcl 8.7 with Tk 9.0. Test result summaries are online. The proper, official methods for getting the version of Tk are:
There are equivalents for Tcl, as well as |
In Python syntax, the first two are still probably better done as e.g.
The only times I am aware that Tkinter needs to know Tcl/Tk versions without an interpreter are when configuring and compiling. But that is done using the macros from <tcl.h> and <tk.h>, after either providing the right Tcl/Tk compiler flags to the configure script or by using pkg-config (which is what many other FOSS projects use; Tcl/Tk provides much less via pkg-config than in tclConfig.sh/tkConfig.sh, but with https://core.tcl-lang.org/tcl/info/4b11db28e63d there now seems to be just enough for Tkinter to build). |
Has it been determined whether tcl/tk 9 will have full unicode support? Is there any approximate target date? |
In #124111 , Mark Culler, member of the Tcl Core Team (TCT), says "The TclTk project has decided that there will be no release of the 8.7 branches." and "8.6.15 and 9.0 versions of Tcl and Tk currently have release candidates, while Tcl and Tk 8.7 have never reached beta". Also, 9.0 will have full unicode support (no CESU-8). |
Tk 8.7 will be compatible with both Tcl 8.7 and Tcl 9.0; there is no Tk 9.0 currently in development. The version and/or patchlevel of Tcl and Tk will not necessarily be identical, but there are places in Tkinter code which assume they are. A few examples which I am aware of:cpython/Lib/idlelib/help_about.py
Line 79 in 48b3617
cpython/Lib/test/test_tkinter/support.py
Line 103 in 48b3617
cpython/Lib/test/test_tcl.py
Line 28 in 48b3617
Linked PRs
The text was updated successfully, but these errors were encountered: