pylint #87192 AttributeError: 'Getattr' object has no attribute 'name' [validation pending]
This error message occurs when I have a decorator that is a part of an imported module. The error occurs when the decorator includes a module in the name it seems. THe error message comes from line 116 in checkers/base.py. I was able to "fix" the system by adding an additional check in the conditional:
if (isinstance(decorator, astng.Getattr) and
I'm not sure if this is the *right* way to handle it, but it at least lets me keep using PyLint. | |
priority | important |
---|---|
type | bug |
done in | 0.25.2 |
load left | 0.000 |
closed by | #c0a307bd6161 fix crash when decorators are accessed through more than one dot. Closes #87192 |
Comments
-
2012/03/06 02:45, written by anon
-
2014/04/21 19:40, written by remram
Still occurs with pylint 1.2.0
Patch I used:
-
2014/04/22 08:07, written by sthenault
add commentEditing checkers/base.py did not fix this error for me.
Traceback (most recent call last):
File "/Users/geordan/venv/tps/bin/pylint", line 4, in <module>
lint.Run(sys.argv[1:])
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/lint.py", line 879, in __init__
linter.check(args)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/lint.py", line 502, in check
self.check_astng_module(astng, walker, rawcheckers)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/lint.py", line 574, in check_astng_module
walker.walk(astng)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
self.walk(child)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
self.walk(child)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/utils.py", line 528, in walk
self.walk(child)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/utils.py", line 525, in walk
cb(astng)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/checkers/variables.py", line 369, in visit_excepthandler
clobbering, args = clobber_in_except(node.name)
File "/Users/geordan/venv/tps/lib/python2.7/site-packages/pylint/checkers/utils.py", line 41, in clobber_in_except
return (True, (node.attrname, 'object %r' % (node.expr.name,)))
AttributeError: 'Getattr' object has no attribute 'name'
This is occuring in pylint 25.1.
could you please submit this issue on the new bitbucket tracker (https://bitbucket.org/logilab/pylint/issues) including the minimal snippet of code demonstrating the pb?