Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astroid 2.3.0 is causing RecursionError #3123

Closed
weijiewu8 opened this issue Sep 24, 2019 · 4 comments
Closed

astroid 2.3.0 is causing RecursionError #3123

weijiewu8 opened this issue Sep 24, 2019 · 4 comments
Labels
Astroid Related to astroid Bug 🪲 Crash 💥 A bug that makes pylint crash

Comments

@weijiewu8
Copy link

My code is very long and I'm not sure which part of the code is causing the RecursionError, but the report seems exactly the same as this one: #2734
The code passes pylint until today when pylint is upgraded to 2.4.0 and astroid to 2.3.0. Downgrading pylint to 2.3.0 and astroid to 2.2.5 resolves the issue.

@asottile
Copy link
Contributor

seeing this as well, here's a concrete reproduction

I'm seeing this in flake8 https://gitlab.com/pycqa/flake8

The easiest reproduction is:

git clone git@gitlab.com:pycqa/flake8
cd flake8
git checkout 121ea4f056fabc82d870cf5deaaf37f035be6d10
tox -e pylint

It (successfully?) finishes but spews 2300+ lines of output

$ head -20 log
pylint create: /tmp/x/flake8/.tox/pylint
pylint installdeps: pyflakes, pylint
pylint installed: astroid==2.3.0,isort==4.3.21,lazy-object-proxy==1.4.2,mccabe==0.6.1,pyflakes==2.1.1,pylint==2.4.0,six==1.12.0,typed-ast==1.2.0,wrapt==1.11.2
pylint run-test-pre: PYTHONHASHSEED='3707048330'
pylint run-test: commands[0] | pylint src/flake8
Traceback (most recent call last):
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/__init__.py", line 91, in _inference_tip_cached
    return iter(_cache[func, node])
KeyError: (<function register_builtin_transform.<locals>._transform_wrapper at 0x7f9af9864510>, <Call l.40 at 0x7f9af56b73c8>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/__init__.py", line 91, in _inference_tip_cached
    return iter(_cache[func, node])
KeyError: (<function register_builtin_transform.<locals>._transform_wrapper at 0x7f9af9864510>, <Call l.40 at 0x7f9af56b73c8>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
$ tail -20 log
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/inference.py", line 274, in infer_import_from
    stmts = module.getattr(name, ignore_locals=module is self.root())
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/scoped_nodes.py", line 534, in getattr
    result = [self.import_module(name, relative_only=True)]
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/scoped_nodes.py", line 629, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/manager.py", line 178, in ast_from_module_name
    return hook(modname)
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/brain/brain_gi.py", line 134, in _import_gi_module
    raise AstroidBuildingError(modname=modname)
  File "/tmp/x/flake8/.tox/pylint/lib/python3.6/site-packages/astroid/exceptions.py", line 49, in __init__
    super(AstroidBuildingError, self).__init__(message, **kws)
RecursionError: maximum recursion depth exceeded while calling a Python object

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

___________________________________ summary ____________________________________
  pylint: commands succeeded
  congratulations :)

@PCManticore
Copy link
Contributor

Thank you, I can reproduce the issue as well.

@PCManticore PCManticore added Astroid Related to astroid Bug 🪲 Crash 💥 A bug that makes pylint crash labels Sep 25, 2019
sinoroc added a commit to sinoroc/toolmaker that referenced this issue Sep 29, 2019
The current versions of astroid and pylint are problematic:
pylint-dev/pylint#3123
@potiuk
Copy link

potiuk commented Oct 1, 2019

Yeah. would love that fixed as well!

@PCManticore
Copy link
Contributor

Hey folks, this should be fixed with the recent release of astroid=2.4.2. Can you give it a go and let us know if the recursion error still happens for any of you?

feluelle added a commit to feluelle/airflow that referenced this issue Nov 25, 2019
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.
potiuk pushed a commit to apache/airflow that referenced this issue Nov 26, 2019
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 15, 2021
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 17, 2021
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 23, 2021
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 25, 2021
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 2, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 3, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 6, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 8, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 26, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 3, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 7, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 11, 2024
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 12, 2024
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 16, 2024
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 17, 2024
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 6, 2024
Note this dependency was only meant to temporarily fix an issue with pylint and astroid.
See pylint-dev/pylint#3123 for more information.

GitOrigin-RevId: e51e1c770dad235b3fd8fdc330e44b83df8dcc4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Astroid Related to astroid Bug 🪲 Crash 💥 A bug that makes pylint crash
Projects
None yet
Development

No branches or pull requests

4 participants