From 4aed87b5227221f9fb8d7e0c3d318fe1df266524 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 22 Jun 2021 13:05:22 -0700 Subject: [PATCH] Fix downloady.is_special_file. --- voussoirkit/downloady.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/voussoirkit/downloady.py b/voussoirkit/downloady.py index 643e2ba..5f065c1 100644 --- a/voussoirkit/downloady.py +++ b/voussoirkit/downloady.py @@ -379,8 +379,12 @@ def get_permission(prompt='y/n\n>', affirmative=['y', 'yes']): return permission.lower() in affirmative def is_special_file(file): - file = pathclass.Path(file) - return os.path.normcase(file.basename) in SPECIAL_FILENAMES + if isinstance(file, pathclass.Path): + return False + file = pathclass.normalize_sep(file) + file = file.rsplit(os.sep)[-1] + file = os.path.normcase(file) + return file in SPECIAL_FILENAMES def request(method, url, stream=False, headers=None, timeout=TIMEOUT, verify_ssl=True, **kwargs): if headers is None: