I found the bug during a local fuzzing run.
Traceback (most recent call last):
File "pylint/pylint/checkers/utils.py", line 1378, in safe_infer
value = next(infer_gen)
File "astroid/astroid/nodes/node_ng.py", line 160, in infer
for i, result in enumerate(self._infer(context=context)):
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/decorators.py", line 79, in inner
yield next(generator)
~~~~^^^^^^^^^^^
File "astroid/astroid/decorators.py", line 42, in wrapped
for res in _func(node, context):
~~~~~^^^^^^^^^^^^^^^
File "astroid/astroid/nodes/node_classes.py", line 1763, in _infer
for callee in self.func.infer(context):
~~~~~~~~~~~~~~~^^^^^^^^^
File "astroid/astroid/nodes/node_ng.py", line 160, in infer
for i, result in enumerate(self._infer(context=context)):
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/decorators.py", line 79, in inner
yield next(generator)
~~~~^^^^^^^^^^^
File "astroid/astroid/decorators.py", line 42, in wrapped
for res in _func(node, context):
~~~~~^^^^^^^^^^^^^^^
File "astroid/astroid/bases.py", line 185, in _infer_stmts
for inf in stmt.infer(context=context):
~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "astroid/astroid/nodes/node_ng.py", line 140, in infer
for result in self._explicit_inference(
~~~~~~~~~~~~~~~~~~~~~~~~^
self, # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context,
^^^^^^^^
):
^
File "astroid/astroid/inference_tip.py", line 67, in inner
raise e from None
File "astroid/astroid/inference_tip.py", line 64, in inner
result = _cache[func, node, context] = list(func(node, context))
~~~~^^^^^^^^^^^^^^^
File "astroid/astroid/brain/brain_namedtuple_enum.py", line 577, in infer_typing_namedtuple_class
annassign.target.name
AttributeError: 'AssignAttr' object has no attribute 'name'. Did you mean: 'frame'?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "pylint/pylint/utils/ast_walker.py", line 87, in walk
callback(astroid)
~~~~~~~~^^^^^^^^^
File "pylint/pylint/checkers/base/basic_checker.py", line 475, in visit_expr
inferred = utils.safe_infer(expr) if name[:1].isupper() else None
~~~~~~~~~~~~~~~~^^^^^^
File "pylint/pylint/checkers/utils.py", line 1382, in safe_infer
raise AstroidError from e
astroid.exceptions.AstroidError
Steps to reproduce
The following code triggers an
AttributeErrorin astroid:I found the bug during a local fuzzing run.
Current behavior
Expected behavior
No crash
Version info
cec5b897
pylint-dev/pylint@5ba4f69e7
Python 3.14.7
The crash also affects Pylint 4.0.7