From: Michael Tremer Date: Wed, 2 Jul 2025 18:31:03 +0000 (+0000) Subject: buildservice: Fix converting paths to URLs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523e69695ce507b39c227a277988913cd9e1cc71;p=pbs.git buildservice: Fix converting paths to URLs The relpath() function only works on absolute URLs. If we did not get one of those, we need to call path() first to make it absolute. Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 1fd18ebb..eb7073ed 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -194,6 +194,10 @@ class Backend(object): """ Takes a path to a file on the file system and converts it into a URL """ + # Make the path absolute + if not path.startswith("/"): + path = self.path(path) + # Make the path relative path = self.relpath(path)