You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run Python File generates incorrectly quoted script paths on macOS zsh when directory contains spaces #1995
When using the "Run Python File" command in VS Code on macOS with zsh as the default shell, the generated terminal command contains incorrectly nested quotation marks if the Python script is located in a directory whose path contains spaces.
Specifically, the script path is enclosed in single quotes, but additional double quotes are included inside them. As a result, Python interprets these double quotes as literal characters in the filename, causing a file-not-found error.
Confirming on macOS 27.0.1, VS Code 1.145.2, Python Environments 1.42.0,
Python extension 2026.10.0 (also 2026.8.0). Same command: python3 '"/path with spaces/script.py"'. It happens with both zsh and bash.
Disabling the Python Environments extension and reloading the window makes
Run Python File work again, so this is a workaround until it is fixed.
Exact same symptoms here on macOS Tahoe 26.6.2 as well as Sequoia 15.8.1, VS Code 1.145.0 or 1.145.2, Python Environments 1.42.0, zsh: python3 '"/path with spaces/script.py"'.
Disabling Python Environments and restarting the extensions fixed the problem.
PS C:\Folder With Spaces\> & 'C:\Users\Skipper\AppData\Local\Microsoft\WindowsApps\python3.13.exe' '"c:/Folder With Spaces/FolderSize/make_report.py"'
C:\Users\DavidCaplin\AppData\Local\Microsoft\WindowsApps\python3.13.exe: can't open file 'c:\\Folder With Spaces\\"c:\\Folder With Spaces\\FolderSize\\make_report.py"': [Errno 22] Invalid argument
PS C:\Folder With Spaces\>
Activity
leo2kappa commentedon Nov 6, 2026
Confirming on macOS 27.0.1, VS Code 1.145.2, Python Environments 1.42.0,
Python extension 2026.10.0 (also 2026.8.0). Same command:
python3 '"/path with spaces/script.py"'. It happens with both zsh and bash.Disabling the Python Environments extension and reloading the window makes
Run Python File work again, so this is a workaround until it is fixed.
xavier862 commentedon Nov 6, 2026
Exact same symptoms here on macOS Tahoe 26.6.2 as well as Sequoia 15.8.1, VS Code 1.145.0 or 1.145.2, Python Environments 1.42.0, zsh:
python3 '"/path with spaces/script.py"'.Disabling Python Environments and restarting the extensions fixed the problem.
Ary0xploits commentedon Nov 8, 2026
Faced the same issue. Even a simple print("Hello world") would give error. As a temporary fix, I disabled Python environments and it works fine now.
Skipper-is commentedon Nov 9, 2026
Same issue on Windows 11.
Version: 1.145.2 (user setup)
Commit: c4453f8ea430795f941c1b2ff6c9321135a74a02
Date: 2026-11-06T04:28:13Z
Electron: 43.8.3
ElectronBuildId: 15784459
Chromium: 150.0.7871.250
Node.js: 24.22.1
V8: 15.0.245.31-electron.0
@github/copilot: 1.0.103.r41379698026.g3219c66
@github/copilot-sdk: 1.0.27.41379698026.g3219c66
OS: Windows_NT x64 10.0.26200