-
Notifications
You must be signed in to change notification settings - Fork 145
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
Path mappings not working with mixed windows-style/linux path slash #1301
Comments
@karthiknadig, does this seem like debugpy or PVSC? |
For this can you try adding |
If you are using the latest version of python extension which is 2023.8.* and debugpy 1.6.7 and you are seeing this issue let us know. It could also be a bug in Python extension where the client OS is not being explictly sent to debugpy. |
Hi! I am having the same problem. My python extension is 2023.10, but debugpy is 1.5.1 because I am using a rather old version of python. I cannot add "clientOS" to the configuration. I get: Property "clientOS" is not allowed. Below you can see my configuration file. Do you think I should downgrade the python extension? It's a bit more difficult to update the environment I am using.
|
Any news about this issue? |
Did you try this suggestion?
Putting the full path to a file in the path mappings? |
No, this is used by multiple employees. I'm looking for a solution using {workspace} to avoid everyone changing the launch.json for each specific folder. In addition, I tried to declare clientOS, but I got the following warning, which is strange because I looked inside the debugpy code and it seems that this is a valid argument. |
I'm having this same issue. VSCode: 1.96.2 Putting the full path in localRoot works: When using the
It's some issue with either the slashes, or the "c" vs "C", I don't know. Is there a workaround, because hard-coding paths is not acceptable in my use-case either. Using the |
I would hazard a guess that VS code changed the result for We'll likely have to do case insensitive lookups. Not sure why it wasn't already doing this for windows. The translation happens here:
|
It looks like in Windows I could fix the issue by adding I don't know if that's also an issue for debugpy or the VSCode plugin, how they interact, etc, etc. Admittedly, I haven't really dug into anything, just giving clues. |
I believe
Maybe that's the change. |
If that's the case, you'd expect
EDIT (sorry for all the edits): it does throw an error if I use
ONLY the second line allows me to remotely debug my python with breakpoints. |
I know it's confusing - I was confused for almost a full day trying to get the perfect syntax for my localRoot parameter in order for anything to work. But from the clues I gathered, it's BOTH the case-sensitive "C", and also the path need to be escaped windows-style to work.
|
I can't reproduce the path or path escape problems myself, but in my situation the client OS is being sent. This part is crucial in the launch.json though:
That makes the debugger on the server side normalize all casing and path separators. The error that VS code shows is a red herring. It's simply because this item wasn't added here (I'll fix that in the next release): This is also a problem:
I'll submit something to make relative paths on the server paths resolve themselves before being used, but the current version requires the full remote path for path mappings to work. You can't just put You might also want to set this environment variable on the server:
That will output more path information when this isn't working. For example it should print out the client os it thinks is being used:
|
Thanks for following up with this @rchiodo and helping us out. I wasn't aware of the env variable. When set my pydev debugger output shows
However, like @andreeas26 , I'm using debugpy 1.5.1, as I'm on an embedded platform, and it's simply all I'm stuck with. Maybe the old version of debugpy doesn't support the clientOS parameter from VSCode? Is there any other way to set this on my target (the debugpy server) directly? |
Sorry but with 1.51, there isn't a way to set that. You can search for it here: It wasn't even part of the source at that point |
You might try 'ideOS'? It looks like that served the same purpose. Not sure if it will work |
I have a launch.json configuration to attach the debugger to a remote service.
This used to work for a long time, not sure when it stopped working exactly.
Gives error:
The local root is translated into
C:\path\to\workspace/Source/
(notice the forward slashes at the end, and capital C )While the pydev debugger is looking for
c:\path\to\workspace\Source\...\app.py
I tried several ways to make it work, by replacing the ${workspaceRoot} variable with the value with lower c, and correct slashes.
But the only way I managed to make it work is to map exactly the full path of the specific file I want to debug. That's the only way I could see and hit the breakpoint on vscode window.
There are other ways I have tried, many variations with the slashes, but none of them worked. Also sometimes I don't receive the error above, but rather only
Breakpoint in file that does not exist
.Is this a vscode issue or debugpy issue?
The text was updated successfully, but these errors were encountered: