Fix path prefix on windows

Previously, the path prefix was only set if "windows_paths" was true, regardless
of OS. Now the path prefix is always set on windows and never set on other OSes.
This commit is contained in:
Joscha 2021-05-25 14:21:52 +02:00
parent 22c2259adb
commit eb8b915813
2 changed files with 2 additions and 4 deletions

View File

@ -242,7 +242,6 @@ class Crawler(ABC):
config.default_section.working_dir() / section.output_dir(name), config.default_section.working_dir() / section.output_dir(name),
section.redownload(), section.redownload(),
section.on_conflict(), section.on_conflict(),
section.windows_paths(),
) )
@property @property

View File

@ -142,10 +142,9 @@ class OutputDirectory:
root: Path, root: Path,
redownload: Redownload, redownload: Redownload,
on_conflict: OnConflict, on_conflict: OnConflict,
windows_paths: bool,
): ):
if windows_paths: if os.name == "nt":
# Windows limits the path length to 260 for some historical reason # Windows limits the path length to 260 for some historical reason.
# If you want longer paths, you will have to add the "\\?\" prefix # If you want longer paths, you will have to add the "\\?\" prefix
# in front of your path. See: # in front of your path. See:
# https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation # https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation