-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Python Tkinter crashes on macOS 11.1 beta #86646
Comments
The Tkinter module, in a freshly built copy of Python 3.9 built by Brew, using the latest Xcode 12.3 command line tools, crashes on Big Sur 11.1 beta. It emits the following error: macOS 11 or later required ! I believe I recently read on macOS developer documentation, there is a special behavior in the system version reporting now, possibly only taking effect in 11.1 and newer. Basically, if you query the major version first, you'll get 11 or higher. If you query the minor version first, it will switch on compatibility mode and start reporting either 10.15 or 10.16, I'm not terribly sure which, but it does lie and say it's running version 10. |
On macOS 11 the system version is reported as 11.x if the binary was build using Xcode 12, and as 10.16.x for older binaries. |
Note that a python installation created using Mac/BuildScript/build-instalelr.py works fine on macOS 11.0 (I haven't tested on 11.1 beta yet). This may be a problem with homebrew or the way it builds Python and/or Tcl/Tk. |
And I can't report it to Homebrew, either, since they refuse to acknowledge bug reports against beta versions of the OS. I guess I can bug them when 11.1 becomes a stable release, by which time I'll probably be on 11.2. I'll file Feedback with Apple, too, as they're more likely to actually know what's going on. |
I've installed the 11.1 beta (of 2020-11-17) on an Intel-64 virtual machine and installed and run the test suite for the recently released 3.9.1rc1 Universal2 binaries from python.org. The tests, including tkinter tests, run similarly to how they do on 11.0.1. Further, as far as I can tell, there is no place within Python itself where such a message ("macOS 11 or later required !") is emitted; I did not search the Tcl or Tk sources since you didn't say which version is in use. Be aware that 3.9.1rc1 is the first official Python release that supports macOS 11 Big Sur so it may be that the brew version you were using has preliminary patches for Big Sur support that differ from the final versions. Depending what you are trying to do, you might want to use the python.org 3.9.1rc1 or 3.9.1 final (when released) until there is a supported brew version. Or, as Ronald suggest, you may need to track down exactly what and how the brew recipes are building for Tcl, Tk, and Python. Good luck! |
Sorry about that. I didn't know that Big Sur support wasn't added until post-3.9.0. I'll check if Brew has a newer version now, and even if not, if I can install a Git version for testing. Incidentally, the error is occuring inside either the Tk or Tcl frameworks, and it's not a version that Brew supplies. Like the system copies of Python 2 and 3, Brew links its builds against the system Tcl and Tk frameworks, which appear to have some bugs in the beta. Thanks for testing, though. |
If Homebrew links against the Apple-supplied Tcl and Tk frameworks, which are in /System/Library/Frameworks, all bets are off as those are deprecated and hopelessly out-of-date versions of Tcl/Tk 8.5. If tkinter is linked to Tcl and Tk frameworks in /Library/Frameworks and there are Tcl and Tk frameworks there, those are not supplied by Apple; they are either installed by Homebrew from somewhere else (ActiveTcl or perhaps built from source). It can be confusing trying to determine which instance of Tcl or Tk tkinter is actually using at runtime on macOS. The command: python3.9 -m test.pythoninfo will display the patch level of Tk in use. There is some more detail of how it all works here: https://www.python.org/download/mac/tcltk/ |
That command also crashes with the same error. And I already verified with otool -L on the tkinter shared object file that it does indeed link the /System/Library/Frameworks version of both Tcl and Tk. In fact, if I remember correctly, Homebrew's entire stance is to import and build as little as possible, always preferring to link to system bundled frameworks, no matter what. Maybe they'll rethink this one. |
Hi, Homebrew developer here, we're seeing this with macOS 11.1 and I think it's not a python issue but an Apple's Tcl/Tk issue. The backtrace I have is: 0 libsystem_kernel.dylib 0x00007fff2031f462 __pthread_kill + 10 This seems confirmed by the fact that I can reproduce with Apple's own python: $ /usr/bin/python3
Python 3.8.2 (default, Nov 4 2020, 21:23:28)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> root = tkinter.Tk()
macOS 11 or later required !
zsh: abort /usr/bin/python3 I will file a bug report with Apple. |
Reported to Apple as FB8945560 |
@fxcoudert: If you are trying to link with the Apple-provided system Tcl and Tk frameworks, don't. They have been seriously broken since macOS 10.7 and stuck at Tk 8.5.9. The only visible Apple action has been to deprecate them. Any Python on macOS that claims to support tkinter (and, hence, IDLE) *must* be able to link with, and preferably supply, newer versions of Tcl and Tk. And for use on current versions of macOS, that also means Tcl/Tk 8.6.x, not 8.5.x. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: