You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debugpy does not quote spaces in command line arguments. #820
When calling debugpy from command line using the vscode integrated terminal, it does not quote command line arguments.
I saw some similar 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
importsysprint(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
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 :)
I can't upload an image from my work PC but I updated my extension, confirmed via which debugpy that I'm pointing at the 2025.18.0 version, and inspected that file. No double quotes around the $@. And confirmed that my args that have a space fail to be parsed properly by debugpy without my performing the workaround defined above.
I think the fix to the problem is what the user specified? (no fix necessary in debugpy) $@ should be quoted. Is there a script for every terminal type? That would be the only hard part. Determining the quote string if there isn't a per terminal script.
This issue has been closed as it has been labeled with info-needed and has not received the additional information that was requested from the issue author. It has been labeled as info-needed for 7 days.
sorry, i didnt feel the need to add additional comment to Michael Steppe (@J17359) and Rich Chiodo (@rchiodo) . the shell script is still not quoted and the fix should not be in debugpy but the wrapper script shipped with the vscode extension specifically.
i think the fix i suggested makes sense, at the very least for bash.
I will add that if the directory for the project contains spaces in the path that the Python debugger fails to run. Silently. I lost a half day's productivity just working that out so am in a foul mood.
Reality of this is noted, and hopefully remembers ere I waste any more time on it.
Activity
eleanorjboyd commentedon Oct 3, 2025
So this is specifically for no-config debugging?
YLivay commentedon Oct 4, 2025
Yes. This is specifically when using the debugpy wrapper script bundled with the vscode-python-debugger extension.
github-actions commentedon Nov 4, 2025
Hey Eleanor Boyd (@eleanorjboyd), this issue might need further attention.
Yariv (@YLivay), you can help us out by closing this issue if the problem no longer exists, or adding more information.
YLivay commentedon Nov 4, 2025
Hey, yeah this issue still exists. Every time the extension updates I manually reapply the fix.
github-actions commentedon Dec 5, 2025
Hey Eleanor Boyd (@eleanorjboyd), this issue might need further attention.
Yariv (@YLivay), you can help us out by closing this issue if the problem no longer exists, or adding more information.
J17359 commentedon Dec 16, 2025
I'm seeing the same issue as Yariv (@YLivay). Their double quote workaround works for me as well.
VSCode: 1.107.0
Python Debugger Extension: 2025.16.0
eleanorjboyd commentedon Dec 16, 2025
Hi! Please give this a try now - we made some updates the quoting logic
J17359 commentedon Dec 16, 2025
Eleanor Boyd (@eleanorjboyd) which version of this plugin am I looking to install to make sure this works?
eleanorjboyd commentedon Dec 17, 2025
can you try the debugger extension version
2025.18.0it would use the rightdebugpyversion as a resultJ17359 commentedon Dec 17, 2025
I can't upload an image from my work PC but I updated my extension, confirmed via
which debugpythat I'm pointing at the2025.18.0version, and inspected that file. No double quotes around the$@. And confirmed that my args that have a space fail to be parsed properly by debugpy without my performing the workaround defined above.So still seems broken to me.
eleanorjboyd commentedon Dec 17, 2025
Thanks for checking - Rich Chiodo (@rchiodo) maybe this is the next item to tackle in line with the other spacing updates you just made?
rchiodo commentedon Dec 17, 2025
I think the fix to the problem is what the user specified? (no fix necessary in debugpy)
$@should be quoted. Is there a script for every terminal type? That would be the only hard part. Determining the quote string if there isn't a per terminal script.vs-code-engineering commentedon Dec 25, 2025
This issue has been closed as it has been labeled with
info-neededand has not received the additional information that was requested from the issue author. It has been labeled asinfo-neededfor 7 days.YLivay commentedon Dec 25, 2025
sorry, i didnt feel the need to add additional comment to Michael Steppe (@J17359) and Rich Chiodo (@rchiodo) . the shell script is still not quoted and the fix should not be in debugpy but the wrapper script shipped with the vscode extension specifically.
i think the fix i suggested makes sense, at the very least for bash.
please reopen the issue
no config debugging: Allow concurrent debug sessions
bernd-wechner commentedon Apr 30, 2026
I will add that if the directory for the project contains spaces in the path that the Python debugger fails to run. Silently. I lost a half day's productivity just working that out so am in a foul mood.
Reality of this is noted, and hopefully remembers ere I waste any more time on it.