Skip to content

bpo-42170: Fix splitdrive for UNC path with the "\\?\UNC\" prefix#23001

Closed
impact27 wants to merge 1 commit intopython:masterfrom
impact27:patch-3
Closed

bpo-42170: Fix splitdrive for UNC path with the "\\?\UNC\" prefix#23001
impact27 wants to merge 1 commit intopython:masterfrom
impact27:patch-3

Conversation

@impact27
Copy link
Copy Markdown
Contributor

@impact27 impact27 commented Oct 27, 2020

Before PR:

Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.18.1 -- An enhanced Interactive Python.

In [1]: import os.path

In [2]: os.path.splitdrive(r"\\machine\mountpoint\directory")
Out[2]: ('\\\\machine\\mountpoint', '\\directory')

In [3]: os.path.splitdrive(r"\\?\UNC\machine\mountpoint\directory")
Out[3]: ('\\\\?\\UNC', '\\machine\\mountpoint\\directory')

In [4]: 

After PR:

Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.18.1 -- An enhanced Interactive Python.

In [1]: import os.path

In [2]: os.path.splitdrive(r"\\machine\mountpoint\directory")
Out[2]: ('\\\\machine\\mountpoint', '\\directory')

In [3]: os.path.splitdrive(r"\\?\UNC\machine\mountpoint\directory")
Out[3]: ('\\\\?\\UNC\\machine\\mountpoint', '\\directory')

In [4]: 

https://bugs.python.org/issue42170

@impact27
Copy link
Copy Markdown
Contributor Author

impact27 commented Oct 27, 2020

See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation for reference on the \\?\UNC\ prefix

@impact27
Copy link
Copy Markdown
Contributor Author

@impact27 impact27 closed this Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants