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 error on windows when running pylint with a path to an __init__.py file with a lambda and an import, when the file path is specified with different capitalization #10137

Open
DetachHead opened this issue Dec 13, 2024 · 0 comments
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation performance Windows 🪟 Bug affecting only Windows users

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Dec 13, 2024

Bug description

when running pylint on a file path with different capitalization (which is allowed because file paths in windows are case-insensitive), these recursion errors are printed, sometimes infinitely.

i was able to narrow it down to this minimal example where the error is only printed once, but in my codebase it seems to print these errors infinitely, causing a memory leak in the pylint vscode extension (microsoft/vscode-pylint#583) i assume because it's storing the infinite output in memory while it waits for pylint to finish running, which it never does.

# ./tests/sandpit/__init__.py

from tests.sandpit import foo


def asdf():
    return foo.abc()


def fdsa(bar):
    lambda item: item(bar.title())
# ./tests/sandpit/bar.py

def abc(): ...

Command used

error

pylint tests\sandpit\__Init__.py

no error

pylint tests\sandpit\__init__.py

Pylint output

> pylint tests\sandpit\__Init__.py
C:\Users\user\project\.venv\Lib\site-packages\astroid\transforms.py:118: UserWarning: Astroid was unable to transform Expr(value=<Lambda.<lambda> l.9 at 0x1f740428730>).
Some functionality will be missing unless the system recursion limit is lifted.
From pylint, try: --init-hook='import sys; sys.setrecursionlimit(2000)' or higher.
  warnings.warn(

Expected behavior

no error

Pylint version

pylint 3.3.2
astroid 3.3.5
Python 3.13.0 (main, Oct 16 2024, 00:33:24) [MSC v.1929 64 bit (AMD64)]

OS / Environment

windows 11

@DetachHead DetachHead added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Dec 13, 2024
@DetachHead DetachHead changed the title recursion error on windows when running pylint on a path with different capitalization recursion error on windows when running pylint on a path to an __init__.py file with a lambda and an import, when the file path is pecified with different capitalization Dec 13, 2024
@DetachHead DetachHead changed the title recursion error on windows when running pylint on a path to an __init__.py file with a lambda and an import, when the file path is pecified with different capitalization recursion error on windows when running pylint with a path to an __init__.py file with a lambda and an import, when the file path is pecified with different capitalization Dec 13, 2024
@DetachHead DetachHead changed the title recursion error on windows when running pylint with a path to an __init__.py file with a lambda and an import, when the file path is pecified with different capitalization recursion error on windows when running pylint with a path to an __init__.py file with a lambda and an import, when the file path is specified with different capitalization Dec 13, 2024
@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 performance Windows 🪟 Bug affecting only Windows users Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation performance Windows 🪟 Bug affecting only Windows users
Projects
None yet
Development

No branches or pull requests

2 participants