[PATCH] fetch2: Ensure UntrustedUrl.msg is str

Michal Sieron <[email protected]> Mon, 13 Jul 2026 18:28:19 +0200
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <[email protected]>
After e74cfd03afe5aff1f81cbff8c6efcef77c9af618 and related commits were
merged, fetchers call bb.fetch2.check_network_access() with a command,
which is no longer a string, but a list. In case of untrusted URL this
would now cause an exception:
    Exception: TypeError: __str__ returned non-string (type list)

Signed-off-by: Michal Sieron <[email protected]>
---
 lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 4535f55a5..a5772f8a9 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -51,7 +51,7 @@ class UntrustedUrl(BBFetchException):
     """Exception raised when encountering a host not listed in BB_ALLOWED_NETWORKS"""
     def __init__(self, url, message=''):
         if message:
-            msg = message
+            msg = str(message)
         else:
             msg = "The URL: '%s' is not trusted and cannot be used" % url
         self.url = url

---
base-commit: 3a99c26fa581d70ed67bd08a5e0e0d0b18369a7c
change-id: 20260713-untrusted-msg-str-b54fb7f8a8d6

Best regards,
--  
Michal Sieron <[email protected]>