Vscode-python: pyvsc-run-isolated slashes not escaped in Git Bash on Windows

Created on 16 Jul 2020  路  4Comments  路  Source: microsoft/vscode-python

System info:

  • Windows 10
  • VS Code version: 1.47.1
  • Extension version: 2020.6.91350
  • Git Bash

Steps:

  • Create a virtual environment, don't install anything and set it as your interpreter path
  • Enable linting in the repo, and install pylint when prompted

image

Text on the screenshot:

Kim@DESKTOP-BINGO MINGW64 ~/Documents/Work/vscode-python/pythonFiles (main)
$ source c:/Users/Kim/Documents/Work/vscode-python/.venv/Scripts/activate
(.venv) 
Kim@DESKTOP-BINGO MINGW64 ~/Documents/Work/vscode-python/pythonFiles (main)
$ c:/Users/Kim/Documents/Work/vscode-python/.venv/Scripts/python.exe c:\Users\K
im\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\pyvsc-run-isola
ted.py pip install -U pylint
C:\Python38\python.exe: can't open file 'c:UsersKim.vscodeextensionsms-python.python-2020.6.91350pythonFilespyvsc-run-isolated.py': [Errno 2] No such file or directory
(.venv) 
Kim@DESKTOP-BINGO MINGW64 ~/Documents/Work/vscode-python/pythonFiles (main)
$ 

Related: #734 #700 and mayyyybe #11419

area-terminal needs PR reason-regression type-bug

Most helpful comment

In order to get this working, in Terminal -> terminal dropdown -> Select Default Shell, choose anything except Git Bash or WSL Bash.

Interestingly, the escaping in WSL bash looks better but doesn't take the /mnt/ path into account.

image

All 4 comments

Same issue on:

  • Windows 10
  • VS Code version: 1.47.3
  • Extension version: 2020.7.96456
  • Git Bash 2.28.0

Same issue on:

  • Windows 10
  • VS Code 1.48.1
  • Extension: ms-python.python-2020.8.105045
  • Git bash: git version 2.27.0.windows.1

For me it even deleted many of the 'pythonFiles' in the Python extension, I had to completely reinstall the extension to fix the bug. This happened to me after having multiple venvs in my project.

Env:

  • Windows 10
  • VS Code 1.49.0
  • Extension: ms-python.python-2020.8.109390
  • Shell: Windows Powershell

I can not even select my default interpreter now

Quick fix:

  1. Remove extension in VSCode
  2. Close all VSCode instances
  3. Delete extension foldern folder in ?/.vscode/extensions called ms-python.python-{version}
  4. Open VSCode again and install Python extension

In order to get this working, in Terminal -> terminal dropdown -> Select Default Shell, choose anything except Git Bash or WSL Bash.

Interestingly, the escaping in WSL bash looks better but doesn't take the /mnt/ path into account.

image

Was this page helpful?
0 / 5 - 0 ratings