debugpy does not quote spaces in command line arguments.
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Issue
When calling debugpy from command line using the vscode integrated terminal, it does not quote command line arguments.
I saw some similar issues (https://github.com/Microsoft/vscode-python-debugger/issues/767) but these were focused on launching the debugger using launch.json. This issue is about calling debugpy from the terminal.
How to reproduce
import sys
print(f"First arg is: '{sys.argv[1]}'")
print(f"Second arg is: '{sys.argv[2]}'") # should print 'hello world'
In a vscode terminal:
$ debugpy /path/to/script.py hi "hello world"
First arg is: 'hi'
Second arg is: 'hello'
Conclusion
This seems to be caused by a wrapper script this extension ships.
$ which debugpy
~/.vscode/extensions/ms-python.debugpy-2025.10.0-linux-x64/bundled/scripts/noConfigScripts/debugpy
which has:
#! /bin/bash
# Bash script
export DEBUGPY_ADAPTER_ENDPOINTS=$VSCODE_DEBUGPY_ADAPTER_ENDPOINTS
python3 $BUNDLED_DEBUGPY_PATH --listen 0 --wait-for-client $@
The actual command this script ended up executing is:
$ python3 /path/to/.vscode/extensions/ms-python.debugpy-2025.10.0-linux-x64/bundled/libs/debugpy --listen 0 --wait-for-client path/to/script.py hi hello world
As a workaround i changed that wrapper script to use "$@" instead of $@. I'm not sure if this is the correct fix for everyone but worked for my humble usecase :)
- Lingua principale
- TypeScript
- Stelle
- 181
- Fork
- 126
- Merge medio
- 2g 3h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/vscode-python-debugger
-
triage-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
microsoft/vscode-python-debugger#1024 · 1 commento ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 reazione · 1 assegnatario ·
-
triage-needed
microsoft/vscode-python-debugger#1106 · 1 reazione · 2 assegnatari ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 reazione · 1 assegnatario ·
Tutte le issue di microsoft/vscode-python-debugger
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Apertacategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
area:auth FE mvp P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
klasolsson81/jobbliggaren#1788 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
get-convex/migrations#69 ·
-
accessibility angular bug good first issue typescript ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/fineract-backoffice-ui#584 · 1 commento ·