[path] ignore unicode differences in deletes

This commit is contained in:
Sam Schott 2023-07-22 01:49:52 +02:00
parent 52676cec5e
commit da04ef3851

View File

@ -328,7 +328,9 @@ def delete(
"""
err: Optional[OSError] = None
if force_case_sensitive and path != to_existing_unnormalized_path(path):
if force_case_sensitive and not equal_but_for_unicode_norm(
path, to_existing_unnormalized_path(path)
):
err = FileNotFoundError(f"No such file '{path}'")
if raise_error:
raise err