microsoft / microsoft/vscode-isort

Incorrect `settings_path` provided in WSL when formatting Jupyter Notebook cells

Open
#704 2 comments 0 reactions 0 assignees View on GitHub
bug triage-needed
Dominant language
Python
Stars
106
Forks
29
Avg merge
1d 23h
Merged PRs (30d)
12

Description

## Diagnostic Data
- Python version (& distribution if applicable, e.g., Anaconda): 3.11.13
- Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv
- Operating system (and version): AlmaLinuxOS9 on WSL2
- Version of tool extension you are using: 2026.6.0

## Behaviour
### Expected Behavior
A native path of the jupyter notebook file like `/home/mrli/test.ipynb` is provided to `--filename` argument.

### Actual Behavior
A path with WSL prefix like `//wsl+alma9/home/mrli/test.ipynb` is provided to `--filename` argument.

## Reproduction Steps:
Install `isort` in VSCode, use VSCode to open a jupyter notebook in WSL, press `Shift`+`Alt`+`O` in a cell

## Logs:

Click here for detailed logs
2026-07-28 21:36:57.015 [info] /home/mrli/work/04-dqm/emc-online-ad/.venv/bin/python -m isort --version-number
2026-07-28 21:36:57.015 [info] CWD Linter: /home/mrli/work/04-dqm/emc-online-ad
2026-07-28 21:36:57.347 [info]
8.0.1

2026-07-28 21:36:57.348 [info] Version info for isort running for /home/mrli/work/04-dqm/emc-online-ad:
8.0.1

2026-07-28 21:36:57.348 [info] SUPPORTED isort>=7.0.0
FOUND isort==8.0.1

2026-07-28 21:36:57.348 [info] /bin/python -m isort --version-number
2026-07-28 21:36:57.348 [info] CWD Linter: /home/mrli/work/04-dqm/TFMAE
2026-07-28 21:36:57.350 [info]
8.0.1

2026-07-28 21:36:57.350 [info] Version info for isort running for /home/mrli/work/04-dqm/TFMAE:
8.0.1

2026-07-28 21:36:57.350 [info] SUPPORTED isort>=7.0.0
FOUND isort==8.0.1

2026-07-28 21:36:57.373 [info] [Trace - 9:36:57 PM] Sending request 'textDocument/codeAction - (1)'.
2026-07-28 21:36:57.374 [info] [Trace - 9:36:57 PM] Received notification 'textDocument/publishDiagnostics'.
2026-07-28 21:36:57.374 [info] [Trace - 9:36:57 PM] Received notification 'textDocument/publishDiagnostics'.
2026-07-28 21:36:57.385 [info] [Trace - 9:36:57 PM] Received response 'textDocument/codeAction - (1)' in 11ms.
2026-07-28 21:36:58.454 [info] [Trace - 9:36:58 PM] Sending request 'textDocument/codeAction - (2)'.
2026-07-28 21:36:58.456 [info] [Trace - 9:36:58 PM] Received response 'textDocument/codeAction - (2)' in 1ms.
2026-07-28 21:36:59.544 [info] [Trace - 9:36:59 PM] Sending request 'textDocument/codeAction - (3)'.
2026-07-28 21:36:59.545 [info] [Trace - 9:36:59 PM] Received notification 'window/logMessage'.
2026-07-28 21:36:59.545 [info] /home/mrli/work/04-dqm/emc-online-ad/.venv/bin/python -m isort - --filename //wsl+alma9/home/mrli/work/04-dqm/emc-online-ad/_tmp/test.ipynb
2026-07-28 21:36:59.545 [info] [Trace - 9:36:59 PM] Received notification 'window/logMessage'.
2026-07-28 21:36:59.545 [info] CWD Linter: /home/mrli/work/04-dqm/emc-online-ad
2026-07-28 21:36:59.548 [info] [Trace - 9:36:59 PM] Received notification 'window/logMessage'.
2026-07-28 21:36:59.548 [info] [Error - 9:36:59 PM] Traceback (most recent call last):
File "/home/mrli/.vscode-server/extensions/ms-python.isort-2026.6.0/bundled/libs/vscode_common_python_lsp/process_runner.py", line 132, in run_message_loop
result = run_fn(
^^^^^^^
File "/home/mrli/.vscode-server/extensions/ms-python.isort-2026.6.0/bundled/libs/vscode_common_python_lsp/runner.py", line 89, in run_module
runpy.run_module(module, run_name="__main__")
File "", line 229, in run_module
File "", line 88, in _run_code
File "/home/mrli/.vscode-server/extensions/ms-python.isort-2026.6.0/bundled/libs/isort/__main__.py", line 3, in
main()
File "/home/mrli/.vscode-server/extensions/ms-python.isort-2026.6.0/bundled/libs/isort/main.py", line 1122, in main
config = Config(**config_dict)
^^^^^^^^^^^^^^^^^^^^^
File "/home/mrli/.vscode-server/extensions/ms-python.isort-2026.6.0/bundled/libs/isort/settings.py", line 336, in __init__
raise InvalidSettingsPath(settings_path)
isort.exceptions.InvalidSettingsPath: isort was told to use the settings_path: //wsl+alma9/home/mrli/work/04-dqm/emc-online-ad/_tmp as the base directory or file that represents the starting point of config file discovery, but it does not exist.

## Outcome When Attempting Debugging Steps:
Did running it from the command line work? No.

## Extra Details
- The issue is reproducible only in Jupyter Notebook. It does not occur when formatting ·.py· files.
- In version `2025.0.0` a native path is provided correctly and the cell will be formatted. Since `2026.4.0` crashes on my system, `2026.6.0` is the first version in which I encountered this bug.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by formatting a Jupyter Notebook cell in VS Code on WSL and inspect the logged command containing --filename //wsl+alma9. Start from the notebook formatting/code-action entry point and the traceback locations isort/main.py and isort/settings.py. Done means notebook formatting receives a native path and no longer raises InvalidSettingsPath, while .py formatting remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, linux, python, vscode
Domain
devtools, operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.