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

Recursion crash #85

Closed
grigoryvp opened this issue Apr 25, 2019 · 1 comment
Closed

Recursion crash #85

grigoryvp opened this issue Apr 25, 2019 · 1 comment

Comments

@grigoryvp
Copy link
Contributor

Describe the bug

Given lots of Python source code files that import and call each other methods, pyright will fails with "RangeError: Maximum call stack size exceeded" error, while mypy works fine.

To Reproduce

I created a simple generator that can be used to auto-generate a large enough source code base:

git clone https://github.com/grigoryvp/python-src-gen.git
cd python-src-gen
pipenv install
pipenv run python app.py generate --num-files 10000
cd out
npx pyright begin.py

Output is:

npx: installed 1 in 3.212s
No venvPath specified, and no search paths found for configured python interpreter.
Searching for source files
Found 1 source file
Error performing analysis: {}

Expected behavior
Analysis completion

VS Code extension or command-line
I'm running latest command-line version via npx.

@erictraut
Copy link
Collaborator

The internal crash is triggered by an exceptionally long import chain. Such long chains won't appear in real code, but they can occur in contrived cases like this. I've added logic to detect this case and report it as a meaningful error. I've currently set the max import chain length to 256.

heejaechang added a commit to heejaechang/pyright that referenced this issue Nov 3, 2021
merge pyright FI and updated README to include --squash on subtree
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