-
Notifications
You must be signed in to change notification settings - Fork 50
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
Exception AttributeError: "'Context' object has no attribute '_libudev'" in <bound method Context.__del__ of <pyudev.core.Context object at 0x6b922870>> ignored #421
Comments
I can't really diagnose from here. Once the context is created, it must have a |
I also faced this issue which @rag2180 mentioned and I found this. Source - https://www.studytonight.com/python/destructors-in-python Example code to reproduce the error-
Error-
Context class of pyudev.core-
We can modify this class as per the solution given below. Solution I found on StackOverflow- Solution -
or use getattr() with a default:
I also found this - https://stackoverflow.com/questions/18058730/python-attributeerror-on-del These are my findings for the mentioned issue. I haven't tested this solution thoroughly so there can be something that I'm missing here. Please verify if this is a viable solution or not. |
Also in one of the above StackOverflow link, I found a warning from the del hook documentation if it helps-
|
Ok. This looks like a reasonable explanation for why the exception is occurring. I think |
I am getting the following exception in my code randomly. This error was captured using sentry.
Exception AttributeError: "'Context' object has no attribute '_libudev'" in <bound method Context.__del__ of <pyudev.core.Context object at 0x6b922870>> ignored
Following is my code:
The text was updated successfully, but these errors were encountered: