Closed spkl closed 1 month ago
Hey!
I am have the exact same problem.
Added information: I was following this guide to enable debugging Python with command line arguments: https://devblogs.microsoft.com/python/python-in-visual-studio-code-august-2023-release/ > Debugger configuration for running files with arguments
This is the launch.json that got created in the process:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File with Arguments",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
}
]
}
I think this is a dupe of: https://github.com/microsoft/vscode-python-debugger/issues/233
Type: Bug
Behaviour
When the path to the python.exe contains spaces (e. g.
c:\Program Files\Python311\python.exe
), debugging with arguments is not possible.The terminal shows the following:
After a few seconds, an error dialog "Timed out waiting for launcher to connect" appears.
Depending on the path, a workaround can be used by specifying a path with shortened names, e.g.
c:\Progra~1\Python311\python.exe
. This is not easily discoverable.Steps to reproduce:
Precondition: In the settings, the python default interpreter path contains spaces.
Diagnostic data
launch.json
configuration``` Not tested with launch.json. ```
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` 2024-04-11 14:13:27.381 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-04-11 14:13:27.381 [info] Experiment 'pythonREPLSmartSend' is active 2024-04-11 14:13:27.381 [info] Experiment 'pythonSurveyNotification' is active 2024-04-11 14:13:27.381 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-04-11 14:13:27.382 [info] Experiment 'pythonTestAdapter' is active 2024-04-11 14:13:27.382 [info] Default formatter is set to null for workspace c:\Repos\VEcuGenCLI 2024-04-11 14:13:27.382 [info] Test server listening. 2024-04-11 14:13:27.382 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-04-11 14:13:28.475 [info] > pyenv which python 2024-04-11 14:13:28.475 [info] cwd: . 2024-04-11 14:13:33.514 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-04-11 14:13:33.515 [info] Experiment 'pythonREPLSmartSend' is active 2024-04-11 14:13:33.515 [info] Experiment 'pythonSurveyNotification' is active 2024-04-11 14:13:33.515 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-04-11 14:13:33.515 [info] Experiment 'pythonTestAdapter' is active 2024-04-11 14:13:33.515 [info] Default formatter is set to null for workspace c:\Data\Temp\py 2024-04-11 14:13:33.515 [info] Test server listening. 2024-04-11 14:13:33.516 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-04-11 14:13:33.641 [info] > pyenv which python 2024-04-11 14:13:33.641 [info] cwd: . 2024-04-11 14:13:35.744 [info] Shell integration status changed, can confirm it's working. 2024-04-11 14:13:36.273 [info] Starting Pylance language server. 2024-04-11 14:17:15.687 [info] Send text to terminal: c:\Program Files\Python311\python.exe c:\Users\SebastianF\.vscode\extensions\ms-python.debugpy-2024.4.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher 53374 -- C:\Data\Temp\py\script.py aaa ```
Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)``` 2024-04-11 14:13:33.750 [info] Name: Python Debugger 2024-04-11 14:13:33.751 [info] Module: debugpy 2024-04-11 14:17:13.811 [info] DAP Server launched with command: C:\Program Files\Python311\python.exe c:\Users\SebastianF\.vscode\extensions\ms-python.debugpy-2024.4.0-win32-x64\bundled\libs\debugpy\adapter ```
Extension version: 2024.4.0 VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z) OS version: Windows_NT x64 10.0.22621 Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled