From 4f49f9bae6bc38c952cd1b414f44d9603a8d903d Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 22 Jun 2023 20:49:14 +0200 Subject: [PATCH] make_path_safe: remove test for backslashes, fixes #7651 looks like some tools use backslashes in linux/macOS paths. --- src/borg/helpers/fs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/borg/helpers/fs.py b/src/borg/helpers/fs.py index 63d698cdf..68f0cd69f 100644 --- a/src/borg/helpers/fs.py +++ b/src/borg/helpers/fs.py @@ -229,8 +229,6 @@ def make_path_safe(path): `path` contain any '..' elements. """ path = path.lstrip("/") - if "\\" in path: # borg always wants slashes, never backslashes. - raise ValueError(f"unexpected backslash(es) in path {path!r}") if path.startswith("../") or "/../" in path or path.endswith("/..") or path == "..": raise ValueError(f"unexpected '..' element in path {path!r}") path = os.path.normpath(path)