Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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) #644

Open
frakman1 opened this issue Dec 25, 2021 · 0 comments
Labels

Comments

@frakman1
Copy link
Contributor

Bug Report


Context


When I click on a button that launches a thread/function:

app.setCheckBoxChangeFunction(FOLLOW_DESKTOP, followDesktopPressed)

... a call to an open-cv function within that function like cv2.namedWindow(... ) results in this error:

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 0x00007fff9792c380 (most recent call first):
  File "/Users/frak/git/myAppJar/virtualenv/lifx-lan-gui/lights.py", line 1010 in followDesktopPressed
  File "/usr/local/lib/python3.9/site-packages/appJar/appjar.py", line 3783 in <lambda>
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892 in __call__
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1429 in mainloop
  File "/usr/local/lib/python3.9/site-packages/appJar/appjar.py", line 1886 in go
  File "/Users/frak/git/myAppJar/virtualenv/lifx-lan-gui/lights.py", line 1593 in <module>
Abort trap: 6

Expected Behaviour


This used to work in a previous version of python (3.7 maybe) with no errors
I am currently using python 3.9.9 on Mac OS High Sierra

Version Information


Replace this with the result of running your code with the -v flag: python myCode.py -v

appJar: 0.94.0 Python: 3.9.9 TCL: 8.6, TK: 8.6 Platform: Darwin pid: 69923 locale: en_US
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants