1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

handle UNC paths (#2113)

This commit is contained in:
Mike Fährmann 2021-12-19 04:38:49 +01:00
parent 47df50a2ad
commit ac80474371
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -177,8 +177,11 @@ class PathFormat():
self.directory = directory = self.basedirectory
if WINDOWS:
# Enable longer-than-260-character paths on Windows
directory = "\\\\?\\" + os.path.abspath(directory)
# Enable longer-than-260-character paths
if directory.startswith("\\\\"):
directory = "\\\\?\\UNC\\" + directory[2:]
else:
directory = "\\\\?\\" + os.path.abspath(directory)
# abspath() in Python 3.7+ removes trailing path separators (#402)
if directory[-1] != sep: