I have a problem with pylint-requests crashing in 1500 lines python file. I've tries to run in PyCharm debugger, but i have an error __main__.py: error: no such option: --multiproc
. I don't know how to reproduce this bug without pasting 1500 lines of our code. Posting it here so maybe someone else will be able to reproduce it. For now I've forked this project to our private repo and added try-except to ignore astroid.exceptions.AttributeInferenceError (it fails at one file only).
Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/[email protected]/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/__main__.py", line 18, in <module>
pylint.run_pylint()
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
PylintRun(sys.argv[1:])
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/run.py", line 338, in __init__
linter.check(args)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 870, in check
self._check_files(
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 904, in _check_files
self._check_file(get_ast, check_astroid_module, name, filepath, modname)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 930, in _check_file
check_astroid_module(ast_node)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1062, in check_astroid_module
retval = self._check_astroid_module(
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1107, in _check_astroid_module
walker.walk(ast_node)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
[Previous line repeated 2 more times]
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint_requests/checkers/timeout.py", line 26, in visit_call
if not is_requests_func(node.func):
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint_requests/utils.py", line 121, in is_requests_func
) or is_requests_session(node.expr):
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint_requests/utils.py", line 84, in is_requests_session
assigns = _lookup(node)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/pylint_requests/utils.py", line 65, in _lookup
return obj.getattr(node.attrname)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/astroid/bases.py", line 190, in getattr
return self._proxied.getattr(name, context, class_context=False)
File "/Users/user/company/app_name/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 2455, in getattr
raise exceptions.AttributeInferenceError(
astroid.exceptions.AttributeInferenceError: 'META' not found on <ClassDef.NoneType l.0 at 0x10dc9ca30>.