Browse Source

Merge pull request #8447 from ThomasWaldmann/fix-canonical-path-rclone

Location.canonical_path: some fixes, see #8446
TW 8 months ago
parent
commit
349e6e37ef
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/borg/helpers/parseformat.py

+ 3 - 2
src/borg/helpers/parseformat.py

@@ -616,9 +616,10 @@ class Location:
                 path = "/./" + self.path  # /./x = path x relative to cwd
             else:
                 path = self.path
-            return "ssh://{}{}{}{}".format(
+            return "{}://{}{}{}{}".format(
+                self.proto if self.proto else "???",
                 f"{self.user}@" if self.user else "",
-                self._host,  # needed for ipv6 addrs
+                self._host if self._host else "",  # needed for ipv6 addrs
                 f":{self.port}" if self.port else "",
                 path,
             )