improve UNC path handling (#2126)
always call 'abspath()' on the directory path to handle cases when the current working directory is UNC and 'base-directory' is relative.
This commit is contained in:
@@ -178,10 +178,11 @@ class PathFormat():
|
||||
|
||||
if WINDOWS:
|
||||
# Enable longer-than-260-character paths
|
||||
directory = os.path.abspath(directory)
|
||||
if directory.startswith("\\\\"):
|
||||
directory = "\\\\?\\UNC\\" + directory[2:]
|
||||
else:
|
||||
directory = "\\\\?\\" + os.path.abspath(directory)
|
||||
directory = "\\\\?\\" + directory
|
||||
|
||||
# abspath() in Python 3.7+ removes trailing path separators (#402)
|
||||
if directory[-1] != sep:
|
||||
|
||||
Reference in New Issue
Block a user