Author Ivan.Pozdeev
Recipients Ivan.Pozdeev, gvanrossum, serhiy.storchaka, terry.reedy
Date 2018-05-04.02:34:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Attached a fixed script.

`Tk.after()` works from a worker thread, while `Tk.destroy()` doesn't.

That's because Tkinter implements Tcl calls (_tkinter.c:Tkapp_Call) from another thread by posting an event to the interpreter's queue (Tcl_ThreadQueueEvent) and waiting for result. So a call normally works, but would hang if the interpreter's event loop is not running.

`destroy()`'s Python part (Lib\tkinter\ stops the event loop, then makes more Tcl calls -- which hang for the aforementioned reason if made from another thread.
Date User Action Args
2018-05-04 02:34:40Ivan.Pozdeevsetrecipients: + Ivan.Pozdeev, gvanrossum, terry.reedy, serhiy.storchaka
2018-05-04 02:34:40Ivan.Pozdeevsetmessageid: <>
2018-05-04 02:34:40Ivan.Pozdeevlinkissue33412 messages
2018-05-04 02:34:39Ivan.Pozdeevcreate