Skip to content

Pylint crashes: _inference_tip_cached on Python 3.6 on using rtslib_fb #3776

@hyde-00

Description

@hyde-00

Steps to reproduce

  1. Minimum code to reproduce the issue
 from rtslib_fb import Target, FabricModule, TPG fm = FabricModule('iscsi') t = Target(fm, target_name) tpg = TPG(t, 1) 

Current behavior

************* Module tpg_create tpg_create.py:1:0: C0114: Missing module docstring (missing-module-docstring) tpg_create.py:3:0: C0103: Constant name "target_name" doesn't conform to UPPER_CASE naming style (invalid-name) Traceback (most recent call last): File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/__init__.py", line 93, in _inference_tip_cached return iter(_cache[func, node]) KeyError: (<function register_builtin_transform.<locals>._transform_wrapper at 0x7f77d2f42048>, <Call l.399 at 0x7f77d2012ac8>) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/__init__.py", line 93, in _inference_tip_cached return iter(_cache[func, node]) KeyError: (<function _functools_partial_inference at 0x7f77d2f45d90>, <Call l.399 at 0x7f77d2012b70>) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/dev/venv36/bin/pylint", line 11, in <module> sys.exit(run_pylint()) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/__init__.py", line 22, in run_pylint PylintRun(sys.argv[1:]) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/run.py", line 344, in __init__ linter.check(args) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/pylinter.py", line 871, in check self.get_ast, self._iterate_file_descrs(files_or_modules) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/pylinter.py", line 904, in _check_files self._check_file(get_ast, check_astroid_module, name, filepath, modname) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/pylinter.py", line 930, in _check_file check_astroid_module(ast_node) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/pylinter.py", line 1063, in check_astroid_module ast_node, walker, rawcheckers, tokencheckers File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/lint/pylinter.py", line 1107, in _check_astroid_module walker.walk(ast_node) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/utils/ast_walker.py", line 75, in walk self.walk(child) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/utils/ast_walker.py", line 75, in walk self.walk(child) ▽ File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/utils/ast_walker.py", line 72, in walk callback(astroid) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/checkers/base.py", line 781, in visit_call self._check_inferred_class_is_abstract(inferred, node) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/checkers/base.py", line 798, in _check_inferred_class_is_abstract abstract_methods = _has_abstract_methods(inferred) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/checkers/base.py", line 385, in _has_abstract_methods return len(utils.unimplemented_abstract_methods(node)) > 0 File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/checkers/utils.py", line 819, in unimplemented_abstract_methods inferred = safe_infer(obj) File "/opt/dev/venv36/lib64/python3.6/site-packages/pylint/checkers/utils.py", line 1119, in safe_infer value = next(infer_gen) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred yield next(generator) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/decorators.py", line 96, in wrapped res = next(generator) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/bases.py", line 136, in _infer_stmts for inferred in stmt.infer(context=context): File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/node_classes.py", line 357, in infer return self._explicit_inference(self, context, **kwargs) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/__init__.py", line 95, in _inference_tip_cached result = func(*args, **kwargs) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/brain/brain_builtin_inference.py", line 135, in _transform_wrapper result = transform(node, context=context) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/brain/brain_builtin_inference.py", line 507, in infer_property inferred = next(getter.infer(context=context)) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/node_classes.py", line 357, in infer return self._explicit_inference(self, context, **kwargs) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/__init__.py", line 95, in _inference_tip_cached result = func(*args, **kwargs) File "/opt/dev/venv36/lib64/python3.6/site-packages/astroid/brain/brain_functools.py", line 90, in _functools_partial_inference inferred_wrapped_function.args.args or (), AttributeError: 'list' object has no attribute 'args' 

Expected behavior

Continue linting without crash.

pylint --version output

pylint 2.5.3
astroid 2.4.2
Python 3.6.8 (default, Sep 26 2019, 11:57:09)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions