E. Paine <paineeli...@gmail.com> added the comment:

I agree this is a race condition, and have narrowed the issue down to 
wait_visibility with the following also hanging indefinitely (tested against 
the master branch):

import threading
import tkinter as tk
def create_tp():
    t = tk.Toplevel()
    t.wait_visibility()
root = tk.Tk()
tk.Button(root, text="Create", command=lambda:
          threading.Thread(target=create_tp).start()).pack()
root.mainloop()

I agree this is a race condition (presumably between wait_visibility and window 
render) and am pretty sure there is nothing either us or the Tk team can do 
(IMO, this issue should be closed - though thank you for reporting it).
Similar behaviour to issue-42142, though I don't believe threading is used 
there.

> Am I doing something wrong here?
Using threads?! tkinter is known to not like threads and there are several bugs 
which can cause the Python interpreter to crash.

----------
nosy: +epaine, serhiy.storchaka
title: TKinter hanging intermittently - sometimes throwing exception -> Tkinter 
wait_visibility hanging when used in thread
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42491>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to