-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
ntpath not adding slash after drive letters #124167
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
Comments
In my previous PR https://github.com/python/cpython/blob/main/Lib/nturl2path.py Searching for "import nturl2path" on GitHub also shows that a considerable number of people use it. I am curious why these two modules do not have documentation, is it a historical legacy issue? Discussion #120423 They are not restricted by the system, but the functions they provide are Windows-specific file paths. Should we add their documentation? Or keep it that way I want to answer this question, but I don't know if it's a feature or a bug, so we have to read the source code https://github.com/python/cpython/blob/main/Lib/ntpath.py |
oh, ntpath is a part of os.path |
I actually found the issue using pathlib, so I guess it is a serious API change. I have a PR ready to be pushed, if it is something you would like 😀 |
In CommandPrompt, EDIT: The above is not quite right as |
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file says:
|
This is not a bug, it's an oddity of Windows file paths. On POSIX-ish platforms, there are relative ( Footnotes |
So in the above example (or in pathlib) what is the correct way to get |
That would be fine, as would |
Bug report
Bug description:
I would expect the following code to print
'c:\\x\\y'
, yet it prints'c:x\\y'
, Would you expect a PR that changes the current behaviour?CPython versions tested on:
3.10, 3.11, 3.12, 3.13, CPython main branch
Operating systems tested on:
Linux, Windows
The text was updated successfully, but these errors were encountered: