Fix downloady.is_special_file.

This commit is contained in:
voussoir 2021-06-22 13:05:22 -07:00
parent c709a28d08
commit 4aed87b522
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -379,8 +379,12 @@ def get_permission(prompt='y/n\n>', affirmative=['y', 'yes']):
return permission.lower() in affirmative return permission.lower() in affirmative
def is_special_file(file): def is_special_file(file):
file = pathclass.Path(file) if isinstance(file, pathclass.Path):
return os.path.normcase(file.basename) in SPECIAL_FILENAMES 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): def request(method, url, stream=False, headers=None, timeout=TIMEOUT, verify_ssl=True, **kwargs):
if headers is None: if headers is None: