microsoft / microsoft/vscode-black-formatter
Fails to launch when running black with Python 3.15 on NixOS
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 196
- Forks
- 49
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 7
Description
## Diagnostic Data
- Python version (& distribution if applicable, e.g., Anaconda): NixOS Python 3.15
- Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): None
- Operating system (and version): NixOS 26.05 & unstable
- Version of tool extension you are using: 2025.2.0
## Behaviour
### Expected Behavior
The formatter errors with "Black Formatter client: couldn't create connection to server."
### Actual Behavior
The formatter crashed with the error that I have pasted in the appropriate logs section.
## Reproduction Steps:
Set `black-formatter.interpreter` to a Python 3.14 and 3.15 executable. May also need `black-formatter.path` to be set. Cannot be sure as that is required for it to function on NixOS. Will error on 3.15 and is fine ion 3.14. This is most likely due to https://github.com/python/cpython/issues/106309
## Logs:
Click here for detailed logs
2026-09-03 20:13:55.725 [info] Interpreter from setting black-formatter.interpreter: /nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/bin/python3.15
2026-09-03 20:13:55.725 [info] Workspace settings for /home/zax/Documents/coding/Rust/bevy-thue-morse (client side): {
"cwd": "/home/zax/Documents/coding/Rust/bevy-thue-morse",
"workspace": "file:///home/zax/Documents/coding/Rust/bevy-thue-morse",
"args": [],
"path": [
"/nix/store/zh5bhwn98n0rgayaj7i7bggzfma94012-python3.14-black-26.5.1/bin/black"
],
"interpreter": [
"/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/bin/python3.15"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2026-09-03 20:13:55.725 [info] Server: Stop requested
2026-09-03 20:13:55.725 [error] Server: Stop failed: Error: Client is not running and can't be stopped. It's current state is: startFailed
2026-09-03 20:13:55.726 [info] Global settings (client side): {
"cwd": "/home/zax/Documents/coding/Rust/bevy-thue-morse",
"workspace": "/home/zax/Documents/coding/Rust/bevy-thue-morse",
"args": [],
"path": [
"/nix/store/zh5bhwn98n0rgayaj7i7bggzfma94012-python3.14-black-26.5.1/bin/black"
],
"interpreter": [],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2026-09-03 20:13:55.727 [info] Server run command: /nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/bin/python3.15 /home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py
2026-09-03 20:13:55.727 [info] Server: Start requested.
2026-09-03 20:13:55.727 [debug] Server State: Starting
2026-09-03 20:13:56.111 [info] Traceback (most recent call last):
2026-09-03 20:13:56.112 [info] File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py", line 69, in
from pygls import server, uris, workspace
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/pygls/server.py", line 35, in
import cattrs
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/__init__.py", line 3, in
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/converters.py", line 17, in
from ._compat import (
...<37 lines>...
)
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/_compat.py", line 56, in
from typing_extensions import TypedDict as ExtensionsTypedDict
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/typing_extensions.py", line 3641, in
no_type_check_decorator = typing.no_type_check_decorator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/lib/python3.15/typing.py", line 3947, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
2026-09-03 20:13:56.152 [info] [Error - 20:13:56] Server initialization failed.
2026-09-03 20:13:56.152 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.152 [info] [Info - 20:13:56] Connection to server got closed. Server will restart.
2026-09-03 20:13:56.152 [info] true
2026-09-03 20:13:56.152 [debug] Server State: Stopped
2026-09-03 20:13:56.152 [debug] Server State: Starting
2026-09-03 20:13:56.152 [debug] Server State: Stopped
2026-09-03 20:13:56.152 [info] [Error - 20:13:56] Black Formatter client: couldn't create connection to server.
2026-09-03 20:13:56.152 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.157 [info] [Error - 20:13:56] Server process exited with code 1.
2026-09-03 20:13:56.501 [info] Traceback (most recent call last):
2026-09-03 20:13:56.501 [info] File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py", line 69, in
from pygls import server, uris, workspace
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/pygls/server.py", line 35, in
import cattrs
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/__init__.py", line 3, in
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/converters.py", line 17, in
from ._compat import (
...<37 lines>...
)
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/_compat.py", line 56, in
from typing_extensions import TypedDict as ExtensionsTypedDict
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/typing_extensions.py", line 3641, in
no_type_check_decorator = typing.no_type_check_decorator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/lib/python3.15/typing.py", line 3947, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
2026-09-03 20:13:56.501 [info] AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
2026-09-03 20:13:56.542 [info] [Error - 20:13:56] Server process exited with code 1.
2026-09-03 20:13:56.542 [info] [Error - 20:13:56] Server initialization failed.
2026-09-03 20:13:56.542 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.542 [info] [Info - 20:13:56] Connection to server got closed. Server will restart.
2026-09-03 20:13:56.542 [info] true
2026-09-03 20:13:56.542 [debug] Server State: Starting
2026-09-03 20:13:56.542 [debug] Server State: Stopped
2026-09-03 20:13:56.542 [info] [Error - 20:13:56] Black Formatter client: couldn't create connection to server.
2026-09-03 20:13:56.542 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.543 [error] Server: Start failed: Error: Pending response rejected since connection got disposed
2026-09-03 20:13:56.865 [info] Traceback (most recent call last):
2026-09-03 20:13:56.865 [info] File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py", line 69, in
from pygls import server, uris, workspace
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/pygls/server.py", line 35, in
import cattrs
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/__init__.py", line 3, in
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/converters.py", line 17, in
from ._compat import (
...<37 lines>...
)
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/_compat.py", line 56, in
from typing_extensions import TypedDict as ExtensionsTypedDict
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/typing_extensions.py", line 3641, in
no_type_check_decorator = typing.no_type_check_decorator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/lib/python3.15/typing.py", line 3947, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
2026-09-03 20:13:56.865 [info] AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
2026-09-03 20:13:56.915 [info] [Error - 20:13:56] Server process exited with code 1.
2026-09-03 20:13:56.915 [info] [Error - 20:13:56] Server initialization failed.
2026-09-03 20:13:56.915 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.915 [info] [Info - 20:13:56] Connection to server got closed. Server will restart.
2026-09-03 20:13:56.915 [info] true
2026-09-03 20:13:56.915 [debug] Server State: Starting
2026-09-03 20:13:56.915 [debug] Server State: Stopped
2026-09-03 20:13:56.915 [info] [Error - 20:13:56] Black Formatter client: couldn't create connection to server.
2026-09-03 20:13:56.915 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:56.915 [info] [Error - 20:13:56] Restarting server failed
2026-09-03 20:13:56.915 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.233 [info] Traceback (most recent call last):
2026-09-03 20:13:57.234 [info] File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py", line 69, in
from pygls import server, uris, workspace
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/pygls/server.py", line 35, in
import cattrs
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/__init__.py", line 3, in
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/converters.py", line 17, in
from ._compat import (
...<37 lines>...
)
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/_compat.py", line 56, in
from typing_extensions import TypedDict as ExtensionsTypedDict
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/typing_extensions.py", line 3641, in
no_type_check_decorator = typing.no_type_check_decorator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/lib/python3.15/typing.py", line 3947, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
2026-09-03 20:13:57.234 [info] AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
2026-09-03 20:13:57.273 [info] [Error - 20:13:57] Server process exited with code 1.
2026-09-03 20:13:57.274 [info] [Error - 20:13:57] Server initialization failed.
2026-09-03 20:13:57.274 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.274 [info] [Info - 20:13:57] Connection to server got closed. Server will restart.
2026-09-03 20:13:57.274 [info] true
2026-09-03 20:13:57.274 [debug] Server State: Starting
2026-09-03 20:13:57.274 [debug] Server State: Stopped
2026-09-03 20:13:57.274 [info] [Error - 20:13:57] Black Formatter client: couldn't create connection to server.
2026-09-03 20:13:57.274 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.274 [info] [Error - 20:13:57] Restarting server failed
2026-09-03 20:13:57.274 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.589 [info] Traceback (most recent call last):
2026-09-03 20:13:57.589 [info] File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/tool/lsp_server.py", line 69, in
from pygls import server, uris, workspace
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/pygls/server.py", line 35, in
import cattrs
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/__init__.py", line 3, in
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/converters.py", line 17, in
from ._compat import (
...<37 lines>...
)
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/cattrs/_compat.py", line 56, in
from typing_extensions import TypedDict as ExtensionsTypedDict
File "/home/zax/.vscode-oss/extensions/ms-python.black-formatter-2025.2.0/bundled/libs/typing_extensions.py", line 3641, in
no_type_check_decorator = typing.no_type_check_decorator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4pr7s4i978w43nzdl5g4sbs3k2cyyk45-python3-3.15.0rc1/lib/python3.15/typing.py", line 3947, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
2026-09-03 20:13:57.625 [info] [Error - 20:13:57] Server process exited with code 1.
2026-09-03 20:13:57.625 [info] [Error - 20:13:57] Server initialization failed.
2026-09-03 20:13:57.625 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.626 [info] [Error - 20:13:57] The Black Formatter server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
2026-09-03 20:13:57.626 [info] [Error - 20:13:57] Black Formatter client: couldn't create connection to server.
2026-09-03 20:13:57.626 [info] Message: Pending response rejected since connection got disposed
Code: -32097
2026-09-03 20:13:57.626 [info] [Error - 20:13:57] Restarting server failed
2026-09-03 20:13:57.626 [info] Message: Pending response rejected since connection got disposed
Code: -32097
## Outcome When Attempting Debugging Steps:
Did running it from the command line work? Running `black` from the CLI does work.
## Extra Details
This seems to be irrelevent of the environment. I don't even have a folder open currently but the same issue is repeatable irrelevant of that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the startup failure with the Python 3.15 interpreter, then trace the import chain from bundled/tool/lsp_server.py through bundled/libs/cattrs and bundled/libs/typing_extensions.py. Use the AttributeError in typing as the starting point and verify that the Black Formatter server launches successfully on Python 3.15 while retaining Python 3.14 support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nixos, python, vscode
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100