-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quotes removed from parameter when calling os.spawn() #263
Comments
I believe the problem here is that the quoting logic is not entirely correct. On Unix, it's easier because it's already dealing with separated arguments, but on Windows, it only has the original command line as a single string, so basically has to replicate the argument parsing logic that's used by the apps. There's no single right answer there, because they can and do handle it differently; and maybe we'll need a parameter to distinguish those. But this looks like a very straightforward case that should "just work". Nor can it really skip parsing the args entirely, because it needs the result to inject Python and pydevd in there. |
I'll take a look at it. |
This was actually an oversight on the case where patching was not actually needed (the first thing we do is unquote args to deal with them and in the case where we do patch the args, everything works because we apply quotes back when needed, but on the case where the patch wasn't needed in the first place because it's not calling a new python executable it was returning the unquoted version instead of the original args). |
When passing arguments to a new process the quotes are removed in the monkey-patched version os.spawn of debugpy in debugpy/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py in function
patch_args()
.It seems to be possible to avoid this by setting
apply_arg_patching
to False, but I don't know how to pass this parameter to the debugger in VSCodeEnvironment:
Windows 10
VSCode 1.45.1
Example:
C-Program to call:
Python Program:
Output without debugger:
Output with debugger:
The text was updated successfully, but these errors were encountered: