-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
AttributeError: '_thread._local' object has no attribute 'srcdc' #273
Comments
well fixed the issue by changing the following if anyone else runs into this:
|
I have the same error happening now, it never happened before. I have no idea of the cause, but it's totally breaking my app. Your solution is disadvised in the documentation, But it does fix the issue. So the issue is indeed that for some reason when instanciating mss.mss() inside a thread it now cannot be called outside. |
Yeah I’ll leave the issue open to try and get a real fix. The other solution I’ve seen is downgrading to a version that works (possibly v6. I didn’t give that a try though) |
Thanks for temporary solution. It does make sense. I would like to ask any updates on fixing this bug. |
MSS Version: 9.0.1
Python Version: 3.10.11
Windows 10 22H2
Exception in thread Thread-1 (update):
Traceback (most recent call last):
File "C:threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "d:PlayerHealth.py", line 29, in update
img = np.array(self.ms.grab(self.healthBox))
File "C:mss\base.py", line 90, in grab
screenshot = self._grab_impl(monitor)
File "C:mss\windows.py", line 235, in _grab_impl
srcdc, memdc = self._handles.srcdc, self._handles.memdc
AttributeError: '_thread._local' object has no attribute 'srcdc'
Upvote & Fund
The text was updated successfully, but these errors were encountered: