Skip to content

Run Python File passes literal quotes in script path to terminal #26274

Agent suggestions

Public preview

Description

Description

Behaviour

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

  1. Install and enable the Python and Python Environments extensions.
  2. Open a Python file inside a directory with spaces in its path.
  3. Click the top-right Run Python File button.
  4. 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
  • OS: macOS
  • Terminal shell: zsh

Issue Details

Item Value
Issue Category Bug
Target Python
Repository Microsoft/vscode-python
VS Code Version Code 1.145.0 (Universal) (a717861c07586a53d83b80d742cd3f59b20a6273, 2026-11-03T15:03:51-08:00)
OS Version Darwin arm64 25.6.0
Extension Identifier ms-python.python
Extension Version 2026.10.0
Extension Publisher ms-python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions