Skip to content
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 'Call' object has no attribute 'name' #5980

Closed
jdavidagudelo opened this issue Mar 25, 2022 · 1 comment
Closed

Crash 'Call' object has no attribute 'name' #5980

jdavidagudelo opened this issue Mar 25, 2022 · 1 comment
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@jdavidagudelo
Copy link

Bug description

When parsing the following file:

def format_manifest_serializer_errors(errors):
    errors_messages = []
    for key, value in errors.items():
        for message in format_manifest_serializer_errors(value):
            error_message = f"{key}: {message}"
            errors_messages.append(error_message)
    return errors_messages

pylint crashed with a AttributeError and with the following stacktrace:

Traceback (most recent call last):
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/lint/pylinter.py", line 1111, in _check_files
    self._check_file(get_ast, check_astroid_module, file)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/lint/pylinter.py", line 1146, in _check_file
    check_astroid_module(ast_node)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/lint/pylinter.py", line 1298, in check_astroid_module
    retval = self._check_astroid_module(
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/lint/pylinter.py", line 1345, in _check_astroid_module
    walker.walk(node)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 76, in walk
    self.walk(child)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 76, in walk
    self.walk(child)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 76, in walk
    self.walk(child)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 73, in walk
    callback(astroid)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/checkers/modified_iterating_checker.py", line 61, in visit_for
    self._modified_iterating_check_on_node_and_children(body_node, iter_obj)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/checkers/modified_iterating_checker.py", line 67, in _modified_iterating_check_on_node_and_children
    self._modified_iterating_check(body_node, iter_obj)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/checkers/modified_iterating_checker.py", line 75, in _modified_iterating_check
    if self._modified_iterating_list_cond(node, iter_obj):
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/checkers/modified_iterating_checker.py", line 124, in _modified_iterating_list_cond
    self._common_cond_list_set(node, iter_obj, infer_val)
  File "/home/jdavidagudelo/.cache/pypoetry/virtualenvs/core-lkCHMl49-py3.10/lib/python3.10/site-packages/pylint/checkers/modified_iterating_checker.py", line 105, in _common_cond_list_set
    node.value.func.expr.name == iter_obj.name
AttributeError: 'Call' object has no attribute 'name'

Configuration

No response

Command used

pylint test.py

Pylint output

Pylint crashes.

Expected behavior

The command should not raise an exception.

Pylint version

pylint 2.13.0

OS / Environment

No response

Additional dependencies

No response

@jdavidagudelo jdavidagudelo added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 25, 2022
@jdavidagudelo jdavidagudelo changed the title Crash 'Call' object has no attribute 'name' (if possible, be more specific about what made pylint crash) Crash 'Call' object has no attribute 'name' Mar 25, 2022
@DanielNoord
Copy link
Collaborator

Duplicate of #5969, although that issue was lacking a code example so posting this example there might help get this resolved!

@DanielNoord DanielNoord added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants