Repository: vscode
Issue: Quotes around paths with spaces are not honored when running tasks
Labels: bug,tasks

Type: <b>Bug</b>

<!-- Please fill in all XXX markers -->
# Behaviour
After updating VSCode for Windows today my project now fails to run any python-based tasks apparently due to spaces in the `${command:python.interpreterPath}` path. The tasks themselves or the `workspaceFolder` have not changes in many months (years?) so it appears vscode or the python plugin changes have broken recently.
Possibly related to https://github.com/microsoft/vscode-python/issues/23028

## Steps to reproduce:
My `tasks.json`
```json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Test Python",
      "type": "shell",
      "options": {
        "cwd": "${workspaceFolder}"
      },
      "command": "${command:python.interpreterPath}",
      "args": ["-c", "import sys;print(sys.executable)"],
      "problemMatcher": []
    }
  ]
}
```
1. Create python virtual environment using venv; ctrl-shift-p; Python: Create Environment; Venv
2. Run `Test Python` task


<!-- **NOTE**: Please do provide logs from Python Output panel. -->
# Diagnostic data
Task fails to run, dialog prompt opens titled: `Select an App to open 'James'`... due to spaces not being properly escaped/quoted? The file is a large log that I have not had time to sanitize yet. But also not very useful, the fact that the filename is my first name tells me its not escaping spaces correctly in the workspace path (which is in my home directory on windows).

If I replace `"command": "${command:python.interpreterPath}"` with `"command": "python"` the task succeeds, and the correct path is printed. But as far as I am aware, this is not the canonical way of specifying the correct python executable, and its unclear if this will cause issue in future versions of vscode and/or other platforms.

Extension version: 2024.8.0
VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:33:54.889Z)
OS version: Windows_NT x64 10.0.22631
Modes:

-   Python version (& distribution if applicable, e.g. Anaconda): 3.11.3
-   Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
-   Value of the `python.languageServer` setting: Default

<details>
<summary>User Settings</summary>
<p>

```

languageServer: "Pylance"

```
</p>
</details>

<details>
<summary>Installed Extensions</summary>

|Extension Name|Extension Id|Version|
|---|---|---|
|Black Formatter|ms-python.black-formatter|2024.2.0|
|C/C++|ms-vscode.cpptools|1.20.5|
|C/C++ Extension Pack|ms-vscode.cpptools-extension-pack|1.3.0|
|C/C++ Themes|ms-vscode.cpptools-themes|2.0.0|
|CMake|twxs.cmake|0.0.17|
|CMake Tools|ms-vscode.cmake-tools|1.18.41|
|Graphviz Interactive Preview|tintinweb.graphviz-interactive-preview|0.3.5|
|JavaScript Debugger|ms-vscode.js-debug|1.90.0|
|JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.2|
|Jupyter|ms-toolsai.jupyter|2024.5.0|
|Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|0.1.9|
|Jupyter Keymap|ms-toolsai.jupyter-keymap|1.1.2|
|Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|1.0.18|
|Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|0.1.6|
|Makefile Tools|ms-vscode.makefile-tools|0.9.10|
|Mypy Type Checker|ms-python.mypy-type-checker|2023.9.11501016|
|Pylance|ms-python.vscode-pylance|2024.6.1|
|Python|ms-python.python|2024.8.0|
|Python Debugger|ms-python.debugpy|2024.7.11591013|
|Sort lines|Tyriar.sort-lines|1.11.0|
|Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9|
</details>
<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|13th Gen Intel(R) Core(TM) i9-13900K (32 x 2995)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|127.77GB (117.38GB free)|
|Process Argv|--crash-reporter-id b8f68be3-ab48-4123-848a-81629c1f3d36|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
jg8ic977:31013176
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
26j00206:31048877

```

</details>

<!-- generated by issue reporter -->