-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Crash 💥A bug that makes pylint crashA bug that makes pylint crashNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Milestone
Description
Bug description
Pylint crashes on this fuzzed code:
i: int
if i:
passConfiguration
Command used
pylint --enable-all-extensions crash.pyPylint output
Traceback (most recent call last):
File "pylint/pylint/utils/ast_walker.py", line 87, in walk
callback(astroid)
~~~~~~~~^^^^^^^^^
File "pylint/pylint/extensions/code_style.py", line 166, in visit_if
self._check_consider_using_assignment_expr(node)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "pylint/pylint/extensions/code_style.py", line 286, in _check_consider_using_assignment_expr
f"({node_name.name} := {prev_sibling.value.as_string()})",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'as_string'Expected behavior
No crash
Pylint version
pylint: bb9df16
astroid: pylint-dev/astroid@bd6e3049db110
Python 3.13.7
OS / Environment
Arch Linux
Additional dependencies
Metadata
Metadata
Assignees
Labels
Crash 💥A bug that makes pylint crashA bug that makes pylint crashNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation