add 'path-extended' option (#3021)

pull/3028/head
Mike Fährmann 2 years ago
parent bc9d291c13
commit 7f30a0d7a7
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -263,6 +263,17 @@ Description
* ``"windows"``: ``". "``
extractor.*.path-extended
-------------------------
Type
``bool``
Default
``true``
Description
On Windows, use `extended-length paths <https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation>`__
prefixed with ``\\?\`` to work around the 260 characters path length limit.
extractor.*.extension-map
-------------------------
Type

@ -24,6 +24,8 @@
"path-replace": "_",
"path-remove": "\\u0000-\\u001f\\u007f",
"path-strip": "auto",
"path-extended": true,
"extension-map": {
"jpeg": "jpg",
"jpe" : "jpg",

@ -105,6 +105,9 @@ class PathFormat():
strip = ". "
self.strip = strip
if WINDOWS:
self.extended = config("path-extended", True)
basedir = extractor._parentdir
if not basedir:
basedir = config("base-directory")
@ -178,7 +181,7 @@ class PathFormat():
else:
self.directory = directory = self.basedirectory
if WINDOWS:
if WINDOWS and self.extended:
# Enable longer-than-260-character paths
directory = os.path.abspath(directory)
if directory.startswith("\\\\"):

Loading…
Cancel
Save