When parsing the following file (with --unsafe-load-any-extension=y):
from black import FileMode
pylint crashed with a AstroidError and with the following stacktrace:
Traceback (most recent call last):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 811, in _lint_file
check_astroid_module(module)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 1085, in check_astroid_module
retval = self._check_astroid_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 1135, in _check_astroid_module
walker.walk(node)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 94, in walk
self.walk(child)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 91, in walk
callback(astroid)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/checkers/variables.py", line 1939, in visit_importfrom
self._check_module_attrs(node, module, name.split("."))
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/checkers/variables.py", line 2963, in _check_module_attrs
module = next(module.getattr(name)[0].infer())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/inference.py", line 334, in infer_import_from
module = self.do_import_module()
^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
return mymodule.import_module(
^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
return AstroidManager().ast_from_module_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/manager.py", line 221, in ast_from_module_name
return self.ast_from_module(named_module, modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/manager.py", line 328, in ast_from_module
return AstroidBuilder(self).module_build(module, modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/builder.py", line 101, in module_build
node = self.inspect_build(module, modname=modname, path=path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/raw_building.py", line 404, in inspect_build
self.object_build(node, module)
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/raw_building.py", line 445, in object_build
class_node = object_build_class(node, member, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/raw_building.py", line 208, in object_build_class
return _base_class_object_build(node, member, basenames, localname=localname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/astroid/raw_building.py", line 316, in _base_class_object_build
instdict = member().__dict__
^^^^^^^^^^^^^^^^^
AttributeError: 'Deprecated' object has no attribute '__dict__'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/tmp/tmp.L5cHJHB1gm/.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/tmp.L5cHJHB1gm/.venv/lib/python3.11/site-packages/pylint/lint/pylinter.py", line 813, in _lint_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
When parsing the following file (with
--unsafe-load-any-extension=y
):pylint crashed with a
AstroidError
and with the following stacktrace:Output of
pip freeze --all
: