From 3b7c7daa76cbab1ec601ef65dfafef143c34702f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 30 Dec 2021 22:22:19 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 2 ++ gallery_dl/path.py | 3 ++- gallery_dl/version.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dc4a218..fdebb172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/gallery_dl/path.py b/gallery_dl/path.py index 9e9e9831..15db67f1 100644 --- a/gallery_dl/path.py +++ b/gallery_dl/path.py @@ -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: diff --git a/gallery_dl/version.py b/gallery_dl/version.py index b5114e80..8ce9d18f 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -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"