palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 281 forks source link

Adding from-stdin = false to toml config causes pylint to hang #966

Open BrianHVB opened 1 year ago

BrianHVB commented 1 year ago

Overview

At the end of the docs on configuration (main section - https://pylint.readthedocs.io/en/latest/user_guide/configuration/all-options.html#main-checker), there is an example configuration section with the following code:

[tool.pylint.main]
analyse-fallback-blocks = false

clear-cache-post-run = false

# ...

from-stdin = false

ignore = ["CVS"]

# ...

If you use this configuration inside of a .toml file, then run pylint on a file, the process will hang indefinitely, with no output. The issue was traced back to the from-stdin setting.

Steps to reproduce

  1. Create a Python project/directory
  2. Create a pyproject.toml file with the following content:
    [tool.pylint.main]
    from-stdin = false
  3. Create a python file (test.py) with some basic Python code
  4. From the project root, run pylint ./test.py
  5. Note that Pylint hangs
  6. Comment out or remove the from-stdin = false line.
  7. Rerun pylint ./test.py
  8. Notice that it runs successfully

Details

pylint 2.17.0
astroid 2.15.0
Python 3.7.3 (default, Oct 31 2022, 14:04:00) 
[GCC 8.3.0]

Linux - Debian 10

virtualenv 20.16.4