Skip to content

(windows) exclude parameter in config causes RAM bloat and infinite loop #9057

@Artalus

Description

@Artalus

Describe the bug

If pyproject.toml has [tool.pyright] exclude = [ 'something/' ], launching pyright causes the node.exe process to go into some infinite loop, crunching at a few % of CPU and (seemingly endlessly) increasing the memory consumption. Even on the minimal repro project, the process did not finish after 2 minutes and grew up 2 gigs of RAM. When run on a real project, the RAM bloat happens faster, growing up to 1 GB in 10-20 seconds.

Code or Screenshots

изображение

# pyproject.toml
[project]
name = 'myproject'
version = '0.1'

[tool.pyright]
exclude = [
    'ignore/',
]
strict = [ 'src/' ]
# src\myproject\__init__.py
def foo(x):
    return x*2
# ignore\folder\ignore.py
# can be empty
PS E:\1> npm i pyright
PS E:\1> pyright

Replacing exclude = with ignore = solves the issue; the analysis is still not run over the ignored directory.

(1) PS E:\1> pyright
e:\1\src\myproject\__init__.py
  e:\1\src\myproject\__init__.py:1:5 - error: Return type is unknown (reportUnknownParameterType)
  e:\1\src\myproject\__init__.py:1:9 - error: Type of parameter "x" is unknown (reportUnknownParameterType)
  e:\1\src\myproject\__init__.py:1:9 - error: Type annotation is missing for parameter "x" (reportMissingParameterType)
  e:\1\src\myproject\__init__.py:2:12 - error: Return type is unknown (reportUnknownVariableType)
4 errors, 0 warnings, 0 informations

VS Code extension or command-line

Command-line.
OS: Windows 10
Python: 3.11.3
pyright: 1.1.381
node: v20.0.0
npm: 9.6.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    as designedNot a bug, working as intendedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions