Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-81790: support "UNC" device paths in ntpath.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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Re-introduce comment with some interesting findings on extended paths.
  • Loading branch information
barneygale committed May 28, 2022
commit 3f163ffadf155df7bb48a421431fc4c34d08e904
15 changes: 15 additions & 0 deletions 15 Lib/ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Show resolved Hide resolved
# 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
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.