-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Crash 'NoneType' object has no attribute 'keywords'
#5153
Comments
Thanks a lot for opening the issue. |
Isn't this a duplicate of #5030? I feel we fixed the issue with non existent |
This one seems to be different. #5030 was fixed in -- Furthermore, there should be one extra line just above the traceback. Something like this: |
I checked out the repository and the error is reported on the import on line 23:
Edit:
The line we're having trouble with is L179: |
Think I found the issue: # pylint: disable=missing-docstring
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
@dataclass
class Expandable(ABC):
"""
A mixin for models which can be "expanded" to a different model which has a
superset of attributes of the current model. Typically this expansion is
expensive (requires an additional api call) which is why it is not done by
default.
"""
# can't annotate with OssapiV2 or we get a circular import error, this is
# good enough
_api: field()
@abstractmethod
def expand(self):
pass --
Should that be |
indeed it should...thanks for the catch. I've pushed a fix for this to my repo and pylint seems to lint fine. Will leave up to you if you'd like to close this issue - it seems reasonable to me to expect that linting that program would throw a better error than pylint crashing, even though it's not the right usage of dataclass' |
@tybug I've opened pylint-dev/astroid#1212 to fix the crash with an invalid field call. I agree that |
Bug description
When parsing the following file (as seen on https://github.com/circleguard/ossapi/blob/master/ossapi/ossapiv2.py):
pylint crashed with a
AttributeError
and with the following stacktrace:~/Desktop λ
Configuration
No response
Command used
Pylint output
Expected behavior
n/a
Pylint version
OS / Environment
macos
Additional dependencies
The text was updated successfully, but these errors were encountered: