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.
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.