Error: PyEval_RestoreThread: NULL tstate in TKinter

I get a very useless error message whenever I click on a menu item in TKinter:

Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application support team for more information. 

The problem is that it is intermittent, about every five or six attempts to click on a menu item, and there are no line numbers or anything that could point me in the right direction. The code base for the program is very large, and since I do not know what part of the code calls it, I do not know what to share in order to try to find the root cause.

This thread says that it can be fixed by updating gtk, but I don't use gtk at all. I am using Python 2.7, tkinter version 8.5 and it works on Windows. If someone knows how I can fix this, or even where I can try to find the code for intruders, I would appreciate it.

If you're fine with thousands of lines of code, here is GitHub and the file that loads the TKinter Code

+5
source share

All Articles