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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user