debugpy does not quote spaces in command line arguments.
まだ誰も着手していません。
評価
この issue はまだ評価されていません。
説明
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 :)
- 主要言語
- TypeScript
- スター
- 181
- フォーク
- 126
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/vscode-python-debugger のほかの issue
-
triage-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/vscode-python-debugger#1024 · コメント 1 件 ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · リアクション 1 件 · 担当者 1 名 ·
-
triage-needed
microsoft/vscode-python-debugger#1106 · リアクション 1 件 · 担当者 2 名 ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · リアクション 1 件 · 担当者 1 名 ·
microsoft/vscode-python-debugger の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·