8000 bpo-33898: Fix pathlib issues with Windows device paths by AlbinaGiliazova · Pull Request #8671 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-33898: Fix pathlib issues with Windows device paths #8671

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

Closed
wants to merge 17 commits into from
Closed
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
Whitespace check
  • Loading branch information
AlbinaGiliazova authored Aug 4, 2018
commit 993d0166389f4666a8281ef9aa9e69551a8c7ad1
7 changes: 3 additions & 4 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ def resolve(self, path, strict=False):
# Means fallback on absolute
return None

def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix,\
ext_prefix2=ext_namespace_prefix2):
def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix, ext_prefix2=ext_namespace_prefix2):
# See https://bugs.python.org/issue33898
prefix = ''
if s.startswith(ext_prefix) or s.startswith(ext_prefix2):
Expand All @@ -227,11 +226,11 @@ def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix,\
s1 = s[:index].upper()
if s1 == 'GLOBAL':
prefix += s[:6]
# For example, Path('//?/Global/Z:/').drive
# For example, Path('//?/Global/Z:/').drive
if s[8] == ':':
prefix += s[6:7]
s = s[7:]
# For example, r'\\?\Global\UNC\server\share'
# For example, r'\\?\Global\UNC\server\share'
elif s[7:10] == 'UNC':
prefix += s[6:10]
s = '\\' +s[10:]
Expand Down
0