This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Logged out of user when running Tkinter
Type: crash Stage: resolved
Components: Tkinter Versions: Python 3.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Jordan, ned.deily
Priority: normal Keywords:

Created on 2020-04-10 20:49 by Jordan, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
2.png Jordan, 2020-04-10 20:49
Messages (4)
msg366153 - (view) Author: J (Jordan) Date: 2020-04-10 20:49
Whenever I run a python script with any Tkinter command, I get instantly logged out of my user. I have been using Tkinter for weeks now and it was running just fine until yesterday when I clicked the demo button in the default taskbar that shows up when launching a Tkinter GUI. It has been crashing now ever since if I include any Tkinter bits in the code. I have been using Python 3.7.7 with the Tkinter version that came with it before this problem started showing up. I have furiously tried everything I could think of (mind me, I'm pretty new to this) including installing preceding and later versions from the official python.org page (3.8.2, 3.8.1, 3.8.0, 3.7.0, 3.6.6 etc.). On some version of python, Tkinter runs and creates the main window with command tk.Tk(), however it would embed it into another window (see attached screenshot). Weird stuff. I've searched across the internet for similar issues to no avail.

Operation System: MacOS Mohave 10.14.6

I hope I'm in the right place to report this abnormal crashing. I would be very thankful for any guidance.
msg366684 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-04-17 22:37
Can you give the exact sequence of steps to reproduce the problem you see, please?
msg366708 - (view) Author: J (Jordan) Date: 2020-04-18 12:51
Thanks for reaching out. I solved the issue following @tcarroll2's solution from: https://github.com/pyenv/pyenv/issues/1375
The issue doesn't occur when using pyenv. It seems that the issue may have been caused by python sticking to the mac provided tkinter (version 8.5) instead of using a compatible version. With pyenv, I get python 3.7.4 and tkinter version 8.6.10 and it works flawlessly :)

Steps to reproduce crash: 
- Downloading Python version 3.8+ from python.org
- Typing python3 in terminal, importing tkinter as tk and starting a window with tk.Tk()
I am immediately logged out of my user. TkVersion is 8.6

Steps to reproduce weird window in window (my guess due to python using mac provided tkinter version 8.5):
- Downloading Python version 3.7.7 or older from python.org or homebrew
- Typing python3 in terminal, importing tkinter as tk and starting a window with tk.Tk()
- Voila! window in window created.

No logging out here, but the window created is unusable and glitchy. I tried running a tkinter GUI that works fine on other setups and the output was missing some widgets etc.
msg366740 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-04-18 20:55
Thanks for the additional info but it still leaves open questions.  The current versions of python.org installers for macOS (3.8.2 and 3.7.7) and various others over the past couple of years all come with a built-in version of Tk 8.6 and that normally cannot be overriden. So if you are seeing indications that Tk 8.5.x is in use, you are somehow not really using those current versions of python.org installers or you are calling out within them directly to an older version of Tk (via a subprocess call, for example).  The Apple-provided Tk 8.5.x on macOS systems is woefully out-of-date and has known critical bugs, like crashing when typing in composite characters (like option-u then U to produce Ü on an English keyboard).  Anyway, since you have solved the issue for you, I am going to close this issue.
History
Date User Action Args
2022-04-11 14:59:29adminsetgithub: 84428
2020-04-18 20:55:34ned.deilysetstatus: open -> closed
resolution: works for me
messages: + msg366740

stage: resolved
2020-04-18 12:51:37Jordansetmessages: + msg366708
2020-04-17 22:37:38ned.deilysetmessages: + msg366684
2020-04-17 18:31:11ned.deilysetnosy: + ned.deily
2020-04-10 20:49:55Jordancreate