Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-81790: support "UNC" device paths inntpath.splitdrive()#91882
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
16 commits Select commitHold shift + click to select a range
c97bfbf gh-81790: support "UNC" device paths in ntpath.splitdrive()
barneygale2da18ba Add docs, news, tests.
barneygale49f9373 Add a couple of comments.
barneygale57840d4 Improve variable names a little
barneygale264d79e Address review feedback
barneygale0652b12 Add a few comments
barneygalebcc561c Fix volume-by-guid path support
barneygale40c1eaf Update Lib/ntpath.py
barneygale34358c8 Update Lib/ntpath.py
barneygale0213a72 Update Lib/ntpath.py
barneygalea7fa62b Revise implementation to affect only paths beginning `\\?\UNC\`.
barneygale992f59d Undo formatting change.
barneygale3f163ff Re-introduce comment with some interesting findings on extended paths.
barneygale4244684 Fix handling of `\\?\UNC` (no trailing slash)
barneygale471e3b4 Remove extending paths findings comment.
barneygale8f9ab9a Remove unnecessary tests
barneygaleFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Re-introduce comment with some interesting findings on extended paths.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit3f163ffadf155df7bb48a421431fc4c34d08e904
There are no files selected for viewing
15 changes: 15 additions & 0 deletionsLib/ntpath.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -118,6 +118,21 @@ def join(path, *paths): | ||
| raise | ||
| # Interesting findings about extended paths: | ||
| # * '\\?\c:\a' is an extended path, which bypasses normal Windows API | ||
| # path processing. Thus relative paths are not resolved and slash is not | ||
| # translated to backslash. It has the native NT path limit of 32767 | ||
| # characters, but a bit less after resolving device symbolic links, | ||
| # such as '\??\C:' => '\Device\HarddiskVolume2'. | ||
| # * '\\?\c:/a' looks for a device named 'C:/a' because slash is a | ||
| # regular name character in the object namespace. | ||
| # * '\\?\c:\foo/bar' is invalid because '/' is illegal in NT filesystems. | ||
| # The only path separator at the filesystem level is backslash. | ||
| # * '//?/c:\a' and '//?/c:/a' are effectively equivalent to '\\.\c:\a' and | ||
| # thus limited to MAX_PATH. | ||
| # * Prior to Windows 8, ANSI API bytes paths are limited to MAX_PATH, | ||
| # even with the '\\?\' prefix. | ||
barneygale marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| # Split a path in a drive specification (a drive letter followed by a | ||
| # colon) and the path specification. | ||
| # It is always true that drivespec + pathspec == p | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.