-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Filenames are lowercased in debug mode #12851
Comments
Hi @ma-sadeghi thanks for the report. @impact27 do you know about this? |
I think this is a windows issue. |
I agree. Windows file names are case insensitive, so if they come like that from the debugger, I think there's little we can do about this. @dalthviz, what do you think? |
I think this is caused since pdb uses a canonical form of path filenames that, as stated in the docstring of the canonic function, transforms the filename into a case-normalized path on case insensitive filesystems (like for example Windows in the practice). So I think there is not much we can do about this |
@dalthviz, what do you think about overriding that function in our debugger and using the filename as defined by the user and not the normalized one? I can understand @ma-sadeghi's confusion after not seeing the file in Spyder with the capitalization shown everywhere else. And I think a lot of other people on Windows could be in the same situation too. |
I'm unsure if possible problems could arise by doing some thing like that (the |
So do you think it's worthwhile exploring that possibility? We could check that things don't break by moving line by line with the debugger and see that things work as before. |
Sure, we can explore the options (either overwriting canonic to prevent the case change of the path or handling the pdb state we send to Spyder to maintain the case of the path at least for Spyder). |
Guys any progress on that? It's annoying when while debugging I save the changes, because file name is renamed to lowercase and imports doesn't work :( |
@degel123, could you better explain what you're doing? I mean, I don't understand what this has to do with saving files. |
The thing is the following: I have an import like |
You mean that after saving the file in Spyder while you're debugging, the file is renamed on disk from |
Yes |
We could open a new file by using https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve (see https://stackoverflow.com/a/54984701) |
But the problem seems to be that Pdb uses canonical file names everywhere, according to what @dalthviz mentioned in #12851 (comment). So we'd to override that. |
Sure, but this is the same situation than if the file was already open. The problem here is:
|
I was thinking something like: #20493 |
Description
What steps will reproduce the problem?
When in debug mode, let's say file a.py calls a function within MixedCase.py, if MixedCase.py is not open, when debugging a.py, the debugger opens up MixedCase.py, but it shows as mixedcase.py, also, hovering the mouse over its tab show the entire directory address as lowercased.
Versions
Dependencies
The text was updated successfully, but these errors were encountered: