Fixes an issue prevents writing paths that end in '...' or similar

This commit is contained in:
64Core 2023-03-18 21:18:40 -05:00
parent b64e8197b9
commit c95b75b085

View file

@ -41,6 +41,8 @@ def clean_path(path):
"""Cleans a path on windows"""
if sys.platform in ["win32", "cygwin", "msys"]:
path_clean = re.sub(r"[<>:|?*\"\/\\]", "-", path)
# This checks for strings that end in ... or similar, weird corner case that affects fewer than 0.1% of titles
path_clean = re.sub(r'(.)[.]\1+$', "-", path_clean)
return path_clean
return path