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.
pull/2197/head
Mike Fährmann 3 years ago
parent 47eae4c393
commit 3b7c7daa76
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,5 +1,7 @@
# Changelog
## Unreleased
## 1.20.0 - 2021-12-29
### Additions
- [500px] add `favorite` extractor ([#1927](https://github.com/mikf/gallery-dl/issues/1927))

@ -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:

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.20.0"
__version__ = "1.20.1-dev"

Loading…
Cancel
Save