You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secure coding is not enabled for restorable state! WARNING on Mac OS Sonoma 14.0 #110950
2023-10-17 08:21:27.948 Python[19831:20908209] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
@u-aida: Note above: "The fix for Tk in the macOS installer has now been merged for release in 3.13.0a2, 3.12.1, and 3.11.7." And this only applies to those Pythons for macOS downloadable from the python.org website. If you are using a Python from another source, contact its distributor and ask them to update their version of Tk.
wait guys i also have this problem, when i implement tkinter even though it pops up a showing window, there is nothing on it even though i followed the steps, but it is just not printing, in the console, there is this line of warning which is simular to the description above.
There seems to be a lot of confusion and conflation of issues here. This issue is closed and was about the secure coding warning that may be seen when using currently released versions of Tk, which is what Python's tkinter uses as a GUI library, on macOS 14 Sonoma. This message is only a warning and can be ignored. As noted above, a patch to eliminate the warning has been applied to the Tk released with the most recent python.org macOS installers (for 3.13.0a2, 3.12.1, and 3.11.7). If you use Python on macOS from another source, the Tk versions used by them would need to be patched to eliminate the warning.
Any other behavior you may be seeing is a different problem, unrelated to this issue. It might be a Tk problem or it might be a Python problem or it might be a usage problem, but it is not this problem. Anyone wanting to pursue another problem should follow the usual procedures, like looking for help in one of the many forums and checking the Python and Tk issue trackers for similar reports.
In this particular case, be aware that Tk 8.5 is extremely old and unsupported and likely has many problems on more recent macOS releases but unfortunately is still shipped by Apple in macOS and is used by the python3 supplied with Xcode and the Command Line Tools. Python 3.9.6 is also very old and 3.9 is now in the security-fix-only phase of its life cycle: the most recent release of Python 3.9 is 3.9.18 and the last full bugfix release with binary installers was 3.9.13. Python 3.11.x and 3.12.x are the current fully-supported release versions.
Note that /usr/bin/python3 also loudly complains about the usage of tkinter:
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
It is highly unlikely that Apple will ever fix issues like this with Tk or upgrade Tk to a newer version. If you want to use Tkinter with Python you need to install a newer version.
Activity
terryjreedy commentedon Oct 17, 2023
For anyone's information,
turtle.homeshould turtle screen to appear with the turtle at the home (origin) position and orientation.ronaldoussoren commentedon Oct 17, 2023
Minimal reproducer:
import tkinter; tkinter.Tk().This is a problem in Tk, not in Tkinter as we don't use Cocoa in the Tkinter source code.
ugandhar84 commentedon Oct 18, 2023
i'm also facing same error - do we have nay resolution for this?
aivarannamaa commentedon Oct 18, 2023
I just created a ticket in Tcl/Tk project: https://core.tcl-lang.org/tk/tktview/10b38a7a7c13235296cb0fbc6205f591d5ed15a4
SimpungaElias commentedon Oct 18, 2023
what to do with this error?
aivarannamaa commentedon Oct 18, 2023
It looks just a warning to me. I haven't seen any misbehaviour in my app after upgrading to Sonoma. So I guess for now you can just ignore it.
ronaldoussoren commentedon Oct 18, 2023
That's correct, this is just a warning from a system library about using functionality that's deprecated in macOS Sonoma.
SimpungaElias commentedon Oct 18, 2023
I am using PyCharm, so the problem is that the UI is not working, all parameters are set well, but all I am seeing is white color background
BenjaminIsMyName commentedon Oct 18, 2023
Minimal reproducer with pygame:
pythongh-110950: add upstream fix to macOS installer
chrstphrchvz commentedon Oct 18, 2023
@SimpungaElias, that issue sounds unrelated to the
Secure coding is not enabled for restorable state!warning.11 remaining items
gh-110950: add upstream Tk fixes to macOS installer. (GH-111041)
pythongh-110950: add upstream Tk fixes to macOS installer. (pythonGH-…
pythongh-110950: add upstream Tk fixes to macOS installer. (pythonGH-…
[3.11] gh-110950: add upstream Tk fixes to macOS installer. (GH-111041)…
[3.12] gh-110950: add upstream Tk fixes to macOS installer. (GH-111041)…
ned-deily commentedon Nov 21, 2023
Thanks for the PR. The fix for Tk in the macOS installer has now been merged for release in 3.13.0a2, 3.12.1, and 3.11.7.
iDevSpread commentedon Dec 4, 2023
I got the same issue, too. Do you fix it?
Heilige-49 commentedon Dec 4, 2023
u-aida commentedon Dec 13, 2023
I got same error pysimplegui with matplotlib.
My environment configuration is
Python: 3.12 (Because of pysimplegui do not work with SONOMA)
Mac OS: 14.2 (Preview version of Sonoma had same issue)
Python problem is happened after I update to Sonoma.
ned-deily commentedon Dec 18, 2023
@u-aida: Note above: "The fix for Tk in the macOS installer has now been merged for release in 3.13.0a2, 3.12.1, and 3.11.7." And this only applies to those Pythons for macOS downloadable from the python.org website. If you are using a Python from another source, contact its distributor and ask them to update their version of Tk.
Wangsd823 commentedon Dec 18, 2023
I had the same problem.
Python: 3.9.6
Tkinter: 8.5
Mac OS: 14.2
ned-deily commentedon Dec 18, 2023
There seems to be a lot of confusion and conflation of issues here. This issue is closed and was about the
secure codingwarning that may be seen when using currently released versions of Tk, which is what Python'stkinteruses as a GUI library, on macOS 14 Sonoma. This message is only a warning and can be ignored. As noted above, a patch to eliminate the warning has been applied to the Tk released with the most recentpython.orgmacOS installers (for 3.13.0a2, 3.12.1, and 3.11.7). If you use Python on macOS from another source, the Tk versions used by them would need to be patched to eliminate the warning.Any other behavior you may be seeing is a different problem, unrelated to this issue. It might be a Tk problem or it might be a Python problem or it might be a usage problem, but it is not this problem. Anyone wanting to pursue another problem should follow the usual procedures, like looking for help in one of the many forums and checking the Python and Tk issue trackers for similar reports.
In this particular case, be aware that Tk 8.5 is extremely old and unsupported and likely has many problems on more recent macOS releases but unfortunately is still shipped by Apple in macOS and is used by the
python3supplied with Xcode and the Command Line Tools. Python 3.9.6 is also very old and 3.9 is now in the security-fix-only phase of its life cycle: the most recent release of Python 3.9 is 3.9.18 and the last full bugfix release with binary installers was 3.9.13. Python 3.11.x and 3.12.x are the current fully-supported release versions.ronaldoussoren commentedon Dec 19, 2023
Note that
/usr/bin/python3also loudly complains about the usage of tkinter:It is highly unlikely that Apple will ever fix issues like this with Tk or upgrade Tk to a newer version. If you want to use Tkinter with Python you need to install a newer version.