add new function (common used): parent_path

This commit is contained in:
Peter Bieringer
2026-02-22 12:23:59 +01:00
parent ce1e5c939a
commit 3eb1669bde

View File

@@ -293,6 +293,10 @@ def path_to_filesystem(root: str, sane_path: str) -> str:
return safe_path
def parent_path(path: str) -> str:
return unstrip_path(posixpath.dirname(strip_path(path)), True)
class UnsafePathError(ValueError):
def __init__(self, path: str) -> None: