Thursday, 1 April 2021

Python app crashed with "PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released"

I have a Python Program, and because it's too big, here's the link to its source code: Link

When I run it on Mac, sometimes I get this weird exception:

Fatal Python error: PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized

Current thread 0x0000000115f8ce00 (most recent call first):
  File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1429 in mainloop
  File ".../PyPlusSource/pyplus.py", line 1435 in <module>

So why is this happenning? Please explain in simple words. Thanks for any ideas!

EDIT:
I'm on MacOS 11.2.3 Big Sur [Not beta], with Python 3.9.2 [Not beta again] installed. And this error is hard to reproduce



from Python app crashed with "PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released"

No comments:

Post a Comment