Skip to content

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

Description

@DetachHead

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🪲Needs PRThis issue is accepted, sufficiently specified and now needs an implementationWindows 🪟Bug affecting only Windows usersperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions