-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Blocker 🙅Blocks the next releaseBlocks the next releaseCrash 💥A bug that makes pylint crashA bug that makes pylint crashRegression
Milestone
Description
Steps to reproduce
- git clone https://github.com/inetum-orleans/docker-devbox-ddb
- cd docker-devbox-ddb
- pylint ddb
- 💥
Current behavior
Pylint crash with the following stack
Traceback (most recent call last):
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/decorators.py", line 34, in cached
return cache[func]
KeyError: <bound method ClassDef.slots of <ClassDef.OrderedSet l.55 at 0x7f75735663d0>>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/toilal/.pyenv/versions/3.8.7-ddb/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
PylintRun(sys.argv[1:])
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/run.py", line 349, in __init__
linter.check(args)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 862, in check
self._check_files(
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 896, in _check_files
self._check_file(get_ast, check_astroid_module, name, filepath, modname)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 922, in _check_file
check_astroid_module(ast_node)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1054, in check_astroid_module
retval = self._check_astroid_module(
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
walker.walk(ast_node)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/pylint/checkers/variables.py", line 1203, in visit_importfrom
module = node.do_import_module(name_parts[0])
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
return mymodule.import_module(
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 646, in import_module
return MANAGER.ast_from_module_name(absmodname)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/manager.py", line 191, in ast_from_module_name
return self.ast_from_file(found_spec.location, modname, fallback=False)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/manager.py", line 100, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/builder.py", line 139, in file_build
return self._post_build(module, encoding)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/builder.py", line 159, in _post_build
self.delayed_assattr(delayed)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/builder.py", line 235, in delayed_assattr
if not _can_assign_attr(inferred, node.attrname):
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/builder.py", line 60, in _can_assign_attr
slots = node.slots()
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/decorators.py", line 36, in cached
cache[func] = result = func(*args, **kwargs)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2838, in slots
slots = list(grouped_slots())
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2823, in grouped_slots
for cls in self.mro()[:-1]:
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2909, in mro
return self._compute_mro(context=context)
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2898, in _compute_mro
unmerged_mro = list(clean_duplicates_mro(unmerged_mro, self, context))
File "/home/toilal/.pyenv/versions/3.8.7/envs/3.8.7-ddb/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 110, in clean_duplicates_mro
raise exceptions.DuplicateBasesError(
astroid.exceptions.DuplicateBasesError: Duplicates found in MROs (OrderedSet), (_GenericAlias, _Final, object), (_GenericAlias, _Final, object), (_GenericAlias, _GenericAlias) for <ClassDef.OrderedSet l.55 at 0x7f75735663d0>.
Expected behavior
It should lint as usual.
pylint --version output
pylint 2.6.0
astroid 2.5
Python 3.8.7 (default, Jan 19 2021, 12:16:28)
[GCC 9.3.0]
Problem occurs after upgrading astroid to 2.5. pip install "astroid<2.5" to workaround the issue.
Metadata
Metadata
Assignees
Labels
Blocker 🙅Blocks the next releaseBlocks the next releaseCrash 💥A bug that makes pylint crashA bug that makes pylint crashRegression