You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pylint crashed with a AstroidError and with the following stacktrace:
Traceback (most recent call last):
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 811, in _lint_file
check_astroid_module(module)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 1085, in check_astroid_module
retval = self._check_astroid_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 1135, in _check_astroid_module
walker.walk(node)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 94, in walk
self.walk(child)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 91, in walk
callback(astroid)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 700, in visit_for
self._check_unnecessary_list_index_lookup(node)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 2229, in _check_unnecessary_list_index_lookup
has_start_arg, confidence = self._enumerate_with_start(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 2347, in _enumerate_with_start
start_val, confidence = self._get_start_value(start_arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 2368, in _get_start_value
start_val = inferred.value if inferred else None
^^^^^^^^^^^^^^
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/astroid/bases.py", line 140, in __getattr__
return getattr(self._proxied, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ClassDef' object has no attribute 'value'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 775, in _lint_files
self._lint_file(fileitem, module, check_astroid_module)
File "/tmp/pylint_crash/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 813, in _lint_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
Pierre-Sassoulas
added
Crash 💥
A bug that makes pylint crash
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Sep 28, 2023
This is a nice one. y is undefined, so int(y) is inferred to be an int. But that seems to be the class int rather than an instance (or some kind of mix-up like that). And the class has no value field, hence the error.
Issues like this and #9074 would probably be caught by proper Astroid typing.
Bug description
When parsing the following file:
pylint crashed with a
AstroidError
and with the following stacktrace:Command used
Pylint output
Expected behavior
no crash
Pylint version
OS / Environment
Ubuntu 20.04.6 LTS
Additional dependencies
The text was updated successfully, but these errors were encountered: