mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
handle UNC paths (#2113)
This commit is contained in:
parent
47df50a2ad
commit
ac80474371
@ -177,8 +177,11 @@ class PathFormat():
|
|||||||
self.directory = directory = self.basedirectory
|
self.directory = directory = self.basedirectory
|
||||||
|
|
||||||
if WINDOWS:
|
if WINDOWS:
|
||||||
# Enable longer-than-260-character paths on 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)
|
||||||
|
|
||||||
# abspath() in Python 3.7+ removes trailing path separators (#402)
|
# abspath() in Python 3.7+ removes trailing path separators (#402)
|
||||||
if directory[-1] != sep:
|
if directory[-1] != sep:
|
||||||
|
Loading…
Reference in New Issue
Block a user