Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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
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()
barneygaleApr 24, 2022
2da18ba
Add docs, news, tests.
barneygaleApr 24, 2022
49f9373
Add a couple of comments.
barneygaleApr 24, 2022
57840d4
Improve variable names a little
barneygaleApr 24, 2022
264d79e
Address review feedback
barneygaleApr 25, 2022
0652b12
Add a few comments
barneygaleApr 25, 2022
bcc561c
Fix volume-by-guid path support
barneygaleApr 26, 2022
40c1eaf
Update Lib/ntpath.py
barneygaleApr 26, 2022
34358c8
Update Lib/ntpath.py
barneygaleApr 26, 2022
0213a72
Update Lib/ntpath.py
barneygaleApr 26, 2022
a7fa62b
Revise implementation to affect only paths beginning `\\?\UNC\`.
barneygaleMay 28, 2022
992f59d
Undo formatting change.
barneygaleMay 28, 2022
3f163ff
Re-introduce comment with some interesting findings on extended paths.
barneygaleMay 28, 2022
4244684
Fix handling of `\\?\UNC` (no trailing slash)
barneygaleMay 31, 2022
471e3b4
Remove extending paths findings comment.
barneygaleMay 31, 2022
8f9ab9a
Remove unnecessary tests
barneygaleJun 9, 2022
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
PrevPrevious commit
NextNext commit
Add a few comments
  • Loading branch information
@barneygale
barneygale committedApr 25, 2022
commit0652b1256b2af13fe22ccd552534be8756c27013
6 changes: 6 additions & 0 deletionsLib/ntpath.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -157,17 +157,23 @@ def splitdrive(p):
normp = p.replace(altsep, sep)
if normp[:4] == prefix:
if normp[4:8] == unc_prefix:
# e.g. \\?\UNC\server\share\dir\file
start = 8
elif normp[5:6] == colon and not normp[6:7].strip(sep):
# e.g. \\?\c:\dir\file
return p[:6], p[6:]
else:
# anything else with a \\?\ prefix
return p[:0], p
else:
if normp[:2] == sep*2 and normp[2:3] != sep:
# e.g. \\server\share\dir\file
start = 2
elif normp[1:2] == colon:
# e.g. c:\dir\file
return p[:2], p[2:]
else:
# anything else
return p[:0], p
# is a UNC path:
# vvvvvvvvvvvvvvvvvvvv drive letter or UNC path
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp