Properly handle Windows case insensitive paths

pull/62/head
Thomas Bouve 2021-09-06 23:59:03 +02:00
rodzic 371aa501f7
commit a2c3f52a7c
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -30,6 +30,9 @@ def get_subpaths(path: str) -> List[str]:
def strip_parent_path(path: str, parent_path: str) -> str:
"""Remove a parent path from a path."""
path = os.path.normcase(path)
parent_path = os.path.normcase(parent_path)
if path == parent_path:
return os.path.sep
elif path.startswith(parent_path):