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 passes literal quotes in script path to terminal #26274
The top-right Run Python File button fails when the Python script is in a path containing spaces and Python Environments handles terminal execution.
Expected: Python runs the selected file.
Actual: The terminal receives a script argument with literal double quotation marks inside single quotes. Redacted equivalent of the observed command:
/usr/local/bin/python3 '"/path with spaces/main.py"'
Python reports [Errno 2] No such file or directory because the double quotation marks become part of the filename. The error path includes the current directory followed by "/path with spaces/main.py" instead of the actual script path.
Steps to reproduce
Install and enable the Python and Python Environments extensions.
Open a Python file inside a directory with spaces in its path.
Click the top-right Run Python File button.
Observe the terminal command and error.
Running the same script directly with a correctly quoted shell path succeeds.
Diagnostic data
VS Code: 1.145.0 (arm64)
Python extension: 2026.10.0
Python Environments extension: 1.42.0
Python interpreter: 3.14.7 at /usr/local/bin/python3
Activity
akoronn commentedon Nov 9, 2026
Bug: "Run Python File" passes literal quotation marks in the script path on Windows PowerShell
Description
When using the Run Python File command in VS Code, extra double quotation marks are included in the script path passed to Python.
As a result, Python cannot locate the script and exits with an
Invalid argumenterror.This issue started occurring after a recent VS Code update. The same workflow worked correctly before the update.
Steps to Reproduce
Actual Behavior
VS Code generates the following command:
Notice that the script path contains an additional pair of double quotation marks inside the single-quoted PowerShell argument.
Python interprets these double quotation marks as part of the filename and fails to open the script.
Error message:
Expected Behavior
The command should pass the script path without the extra literal double quotation marks:
The script should execute normally.
Additional Information
This suggests that the issue is related to command generation or argument quoting in the Python extension's terminal execution path.
Environment
Operating System
VS Code
Python
.venv\Scripts\python.exeExtensions
ms-python.python): 2026.10.0ms-python.debugpy): 2026.7.13061010ms-python.vscode-python-envs): 1.43.2026110501ms-python.vscode-pylance): 2026.4.1