This commit is contained in:
BillSchumacher
2023-04-16 14:15:38 -05:00
parent c544cebbe6
commit 3fadf2c90b
10 changed files with 92 additions and 73 deletions

View File

@@ -36,6 +36,8 @@ def safe_path_join(base: Path, *paths: str | Path) -> Path:
joined_path = base.joinpath(*paths).resolve()
if not joined_path.is_relative_to(base):
raise ValueError(f"Attempted to access path '{joined_path}' outside of working directory '{base}'.")
raise ValueError(
f"Attempted to access path '{joined_path}' outside of working directory '{base}'."
)
return joined_path