Skip to content

Failed to parse WSL-mounted workspace URI in PyCharm on Windows, preventing odools.toml loading #429

@KristjanTehu

Description

@KristjanTehu

Your setup
Version: 1.0.1
Operating System: Windows (with WSL Ubuntu-20.04)
IDE and/or Integration tool: PyCharm - Odoo Language Server plugin

Describe the bug
The Odoo Language Server fails to extract the workspace path from the URI when the project is opened via a WSL-mounted filesystem in PyCharm on Windows. The URI is formatted as "file:////wsl.localhost/Ubuntu-20.04/home/username/dev_code/project_directory" (note the extra slash after "file://"), causing the server to use a default configuration instead of loading odools.toml from the workspace root. This results in no Odoo paths being set and a subsequent "Wrong python command" error due to an empty python_path.

To Reproduce
Steps to reproduce the behavior:

  1. Set up WSL with Ubuntu-20.04 on Windows.
  2. Create an Odoo project in WSL, e.g., at /home/username/dev_code/project_directory, and place a valid odools.toml file in the root.
  3. Open the project in PyCharm using the mounted path: \wsl.localhost\Ubuntu-20.04\home\username\dev_code\project_directory.
  4. Open an Odoo-related Python file or check the Odoo LS tool window/logs—the configuration is not applied, and the error appears in the logs.

Expected behavior
The language server should correctly parse the WSL-mounted URI (handling the network-style path and extra slash), extract the workspace path, and load odools.toml hierarchically from the root or parent directories to configure Odoo paths, addons, and Python interpreter.

Screenshots
Error from the logs:
2025-09-24T07:46:53.101055Z ERROR ThreadId(01) odoo_ls_server::core::file_mgr: Unable to extract path from uri: file:////wsl.localhost/Ubuntu-20.04/home/username/dev_code/project_directory

Additional context
The plugin works when working with the project files directly in Windows or when using a remote development tool to work in WSL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions