debugpy does not quote spaces in command line arguments.
Chưa có ai nhận issue này.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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 :)
- Ngôn ngữ chính
- TypeScript
- Star
- 181
- Fork
- 126
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-python-debugger
-
triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/vscode-python-debugger#1024 · 1 bình luận ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 reaction · 1 người được giao ·
-
triage-needed
microsoft/vscode-python-debugger#1106 · 1 reaction · 2 người được giao ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 reaction · 1 người được giao ·
Tất cả issue của microsoft/vscode-python-debugger
Issue tương tự
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Đang mởclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
supermomonga/zcode-acp#24 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
growthbook/growthbook#7100 ·
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100