-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RecursionError: maximum recursion depth exceeded while linting a large chained method calls #8842
RecursionError: maximum recursion depth exceeded while linting a large chained method calls #8842
Comments
I never know with these kind of issues. Curious to see what others think. |
Ideally, there should be a way to tell the linter, hey, please ignore this line ( At minimum, |
I think we decided at some point that explicitely failing is better than silentely failing the inference and having a poorer result without any explanation. At least here it's possible to increase the recursion limit. Skipping the parsing conditionally will be an enormous feature. Right now skip file mean skipping the linting so it would also need a new concept (like '# astroid: no-inference') |
Thought about it some more, I think we need to transform all crashes into fatal level messages. There's no reason to prevent the remainder of the analysis to take place when there's a crash, and it's still possible to report the crash when it happens (the message being essentially the same but instead of crashing pylint continue working if possible). That way it's possible to ignore the fatal with the disable when they are expected (until the crash is fixed in pylint). I already had some project were pylint was unusable because of a crash related to pandas, nothing to do but to wait for a fix, it's annoying. |
There are several places where we could try to trap RecursionError and reraise it as a fatal (but ignorable) message.
|
|
Include PEP 695 (Python 3.12) generic type syntax nodes in get_children(), allowing checkers to visit them. Refs pylint-dev/pylint#9193 Add __main__ as a possible inferred value for __name__ to improve control flow inference around if __name__ == "__main__": guards. Closes #2071 Following a deprecation period, the names arg to the Import constructor and the op arg to the BoolOp constructor are now required, and the doc args to the PartialFunction and Property constructors have been removed (call postinit(doc_node=...) instead.) Following a deprecation announced in astroid 1.5.0, the alias AstroidBuildingException is removed in favor of AstroidBuildingError. Include modname in AST warnings. Useful for invalid escape sequence warnings with Python 3.12. RecursionError is now trapped and logged out as UserWarning during astroid node transformations with instructions about raising the system recursion limit. Closes pylint-dev/pylint#8842 Suppress SyntaxWarning for invalid escape sequences on Python 3.12 when parsing modules. Closes pylint-dev/pylint#9322
Bug description
When parsing the following file:
Configuration
No response
Command used
Pylint output
Expected behavior
It should not crash.
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: