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

Maximum recursion depth exceeded on simple code #3414

Closed
K900 opened this issue Feb 19, 2020 · 4 comments
Closed

Maximum recursion depth exceeded on simple code #3414

K900 opened this issue Feb 19, 2020 · 4 comments

Comments

@K900
Copy link

K900 commented Feb 19, 2020

Steps to reproduce

  1. Install the latest pylint version
# as of this writing:
astroid==2.3.3
isort==4.3.21
lazy-object-proxy==1.4.3
mccabe==0.6.1
pylint==2.4.4
six==1.14.0
wrapt==1.11.2
  1. Create a file with the following contents:
k = {}
(_ for k in dict(**k))
  1. Run pylint yourfile.py

Current behavior

Pylint crashes with "maximum recursion depth exceeded".

Expected behavior

Pylint does not crash with "maximum recursion depth exceeded".

pylint --version output

pylint 2.4.4
astroid 2.3.3
Python 3.8.1 (default, Jan 22 2020, 06:38:00) 
[GCC 9.2.0]
@K900
Copy link
Author

K900 commented Feb 19, 2020

Interestingly, changing the name of the loop variable to anything other than k, e.g. a or even _, makes this not crash anymore.

@K900
Copy link
Author

K900 commented Feb 19, 2020

Also interestingly, k = {}; (_ for k in {**k}) does not crash.

@K900
Copy link
Author

K900 commented Feb 19, 2020

Also, _ in the original example seems to be completely irrelevant, as long as it's a valid expression (i.e. not a syntax error). 0 for k in ..., None for k in ..., k for k in ..., etc. all crash equivalently.

@PCManticore
Copy link
Contributor

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants