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

Ruff server crash on VSC for python 3.12: TypeError: type 'typing.TypeVar' is not an acceptable base type #200

Closed
amogorkon opened this issue Jun 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@amogorkon
Copy link

Unrecoverable ruff v2023.17.11351528 server crash for python 3.12 on VSC
Version: 1.79.0-insider (user setup)
Commit: aee52551e25d98391f9064996196cd83a9fc8669
Date: 2023-06-06T15:00:13.166Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

Name: Ruff
Module: ruff
Python extension loading
Waiting for interpreter from python extension.
Python extension loaded
Server Command [RUN]: f:\Python312\python.exe c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\tool\server.py
Server Command [DEBUG]: f:\Python312\python.exe c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\tool\_debug_server.py
Traceback (most recent call last):
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\tool\server.py", line 25, in <module>
    from ruff_lsp import server
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\ruff_lsp\server.py", line 52, in <module>
    from pygls import protocol, server, uris, workspace
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\pygls\protocol.py", line 43, in <module>
    from pygls.feature_manager import FeatureManager, assign_help_attrs, is_thread_function
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\pygls\feature_manager.py", line 28, in <module>
    from pygls.lsp import get_method_options_type, is_instance
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\pygls\lsp\__init__.py", line 36, in <module>
    from typeguard import check_type
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\typeguard\__init__.py", line 27, in <module>
    from typing_extensions import Literal
  File "c:\Users\micro\.vscode-insiders\extensions\charliermarsh.ruff-2023.17.11351528-win32-x64\bundled\libs\typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
[Info  - 6:44:39 AM] Connection to server got closed. Server will restart

three times, then
[Error - 6:44:51 AM] Connection to server got closed. Server will not be restarted.

@charliermarsh charliermarsh transferred this issue from astral-sh/ruff Jun 8, 2023
@konstin
Copy link
Member

konstin commented Jun 12, 2023

Not a solution but this was introduced in python/typing_extensions#165, i.e. a recent version of typing_extensions

@charliermarsh charliermarsh self-assigned this Jun 16, 2023
@charliermarsh
Copy link
Member

Ah, ok, this was fixed in python/typing_extensions#162.

@charliermarsh
Copy link
Member

This should be fixed in 2023.18.0 and later, we updated typing_extensions past that version. Let me know if not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants