[issue40452] Tkinter/IDLE: preserve clipboard on closure

E. Paine report at bugs.python.org
Wed May 20 09:51:12 EDT 2020


E. Paine <paineelisha at gmail.com> added the comment:

After some initial testing, I have found that while calling Tcl_Finalize  on window closure keeps the clipboard contents (as expected), it also finishes the Python interpreter.

The solution was to instead use the Tcl_FinalizeThread method, "which you can call if you just want to clean up per-thread state" (https://www.tcl.tk/man/tcl8.4/TclLib/Exit.htm).

Reading this, I was expecting it to stop further Tk instances from being created after the original one was closed, however some initial testing has found this to not be true.

I feel it is too early to create a PR for this yet (I need to do more research and properly understand the calls), but it is quite possible calling this method on root "destroy" is the only thing required to fix this issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40452>
_______________________________________


More information about the Python-bugs-list mailing list