Fix: performance improvement of path_to_filesystem() in 3.7.0 caused unexpected issue in case of softlinks are used

This commit is contained in:
Peter Bieringer
2026-04-11 06:46:56 +02:00
parent 57ac38b502
commit c4ab681858

View File

@@ -286,7 +286,7 @@ def path_to_filesystem(root: str, sane_path: str) -> str:
safe_path = os.path.join(safe_path, part)
# Check for conflicting files (e.g. case-insensitive file systems
# or short names on Windows file systems)
if (os.path.lexists(safe_path) and not os.path.realpath(safe_path).endswith(part)):
if (os.path.lexists(safe_path) and not os.path.realpath(safe_path).endswith(part)) and not os.path.islink(safe_path):
raise CollidingPathError(part)
return safe_path