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

First "~" in workfolder path is replaced with /user/<username> #577

Closed
QuantumChronoton opened this issue Nov 1, 2024 · 6 comments · Fixed by #579
Closed

First "~" in workfolder path is replaced with /user/<username> #577

QuantumChronoton opened this issue Nov 1, 2024 · 6 comments · Fixed by #579
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@QuantumChronoton
Copy link

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): Python 3.12.7 via homebrew
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv
  • Operating system (and version): macOS Sequoia 15.0.1
  • Version of tool extension you are using: Issue is present in 2024.0.0 and onwards.

Behaviour

Expected Behavior

"~" in folder names must be left as is.

Actual Behavior

The first occurrence of the "~" symbol in folder name gets replaced with the /user/, corrupting the path, which leads to the following error:

[error] Server: Start failed: Launching server using command /Users/johndoe/Library/Mobile Documents/com/Users/johndoe appleCloudDocs/ProjectFolder/.venv/bin/python failed. Error: spawn /Users/johndoe/Library/Mobile Documents/com/Users/johndoe appleCloudDocs/ProjectFolder/.venv/bin/python ENOENT

Note the first "" in "comapple~CloudDocs" folder name got replaced with "/Users/johndoe".

Reproduction Steps:

  1. Create a new Python project in a folder with "~" in folder name.
  2. Update Pylint to 2024.0.0 or higher pre-release version.
  3. Open the project and observer the "Pylint client: couldn't create connection to server." error.

Logs:

Click here for detailed logs 2024-11-01 15:38:27.934 [info] Name: Pylint 2024-11-01 15:38:27.934 [info] Module: pylint 2024-11-01 15:38:27.934 [info] Python extension loading 2024-11-01 15:38:27.934 [info] Waiting for interpreter from Python extension. 2024-11-01 15:38:27.934 [info] No interpreter found from setting pylint.interpreter 2024-11-01 15:38:27.934 [info] Getting interpreter from ms-python.python extension for workspace /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder 2024-11-01 15:38:27.934 [info] Python extension loaded 2024-11-01 15:38:27.934 [info] Interpreter from ms-python.python extension for /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder: /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder/.venv/bin/python 2024-11-01 15:38:27.934 [info] No interpreter found from setting pylint.interpreter 2024-11-01 15:38:27.934 [info] Getting interpreter from ms-python.python extension for workspace /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder 2024-11-01 15:38:27.934 [info] Interpreter from ms-python.python extension for /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder: /Users/johndoe/Library/Mobile Documents/com~apple~CloudDocs/ProjectFolder/.venv/bin/python 2024-11-01 15:38:27.934 [info] Server run command: /Users/johndoe/Library/Mobile Documents/com/Users/johndoeapple~CloudDocs/ProjectFolder/.venv/bin/python /Users/johndoe/.vscode/extensions/ms-python.pylint-2024.1.12811009/bundled/tool/lsp_server.py 2024-11-01 15:38:27.934 [info] Server: Start requested. 2024-11-01 15:38:27.934 [info] [Error - 3:38:27 PM] Pylint client: couldn't create connection to server. 2024-11-01 15:38:27.934 [info] Launching server using command /Users/johndoe/Library/Mobile Documents/com/Users/johndoeapple~CloudDocs/ProjectFolder/.venv/bin/python failed. Error: spawn /Users/johndoe/Library/Mobile Documents/com/Users/johndoeapple~CloudDocs/ProjectFolder/.venv/bin/python ENOENT 2024-11-01 15:38:27.934 [error] Server: Start failed: Launching server using command /Users/johndoe/Library/Mobile Documents/com/Users/johndoeapple~CloudDocs/ProjectFolder/.venv/bin/python failed. Error: spawn /Users/johndoe/Library/Mobile Documents/com/Users/johndoeapple~CloudDocs/ProjectFolder/.venv/bin/python ENOENT

Outcome When Attempting Debugging Steps:

Did running it from the command line work? No

Extra Details

The issue is gone when downgrading Pylint to "v2023.11.13481007 (pre-release)".

@QuantumChronoton QuantumChronoton added the bug Issue identified by VS Code Team member as probable bug label Nov 1, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Nov 1, 2024
@kysucix
Copy link

kysucix commented Nov 4, 2024

We experience a similar problem where tilde is replaced to home directory without any way to escape it.

@kysucix
Copy link

kysucix commented Nov 4, 2024

Could we instead rely only on ${userHome} instead of replacing the tilde character? It's a predefined variable in vscode: https://code.visualstudio.com/docs/editor/variables-reference

@karthiknadig
Copy link
Member

@kysucix @QuantumChronoton Can you try this build and see if it helps? https://github.com/microsoft/vscode-pylint/actions/runs/11674148957/artifacts/2143837620

You will have to extract the zip file and use "Install from VSIX" command to install it.

@QuantumChronoton
Copy link
Author

@karthiknadig It worked. Now I see correct paths in the output and Pylint functions as expected.

@kysucix
Copy link

kysucix commented Nov 5, 2024

Yes it works thanks!

@karthiknadig
Copy link
Member

Perfect, I will merge the fix, it should be available in the pre-release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants