From d192c1e50674ec244e1c2edbbcf41479d91c30b9 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Mon, 7 Mar 2022 12:20:12 +0100 Subject: Ignore failed log parsing attempts in Submodule Update Utility Log parsing can fail to decode the response if the content type is incorrectly set. Due to the storage location of some LTS branch build/test logs, the files are incorrectly served as binary data. Ignore these decoding failures, as the storage location for future logging will set the content type headers correctly. Change-Id: I2b0bb3a23505a19991f8a49e3a5117cf48d208ca Reviewed-by: Daniel Smith --- util/dependency_updater/tools/toolbox.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/dependency_updater/tools/toolbox.py b/util/dependency_updater/tools/toolbox.py index 6fc70d4..10c45bf 100644 --- a/util/dependency_updater/tools/toolbox.py +++ b/util/dependency_updater/tools/toolbox.py @@ -404,7 +404,12 @@ def parse_failed_integration_log(config, repo: Repo = None, log_url: str = "") - return "" r = requests.get(log_url) if r.status_code == 200: - log_text = r.content.decode("utf-8") + try: + log_text = r.content.decode("utf-8") + except UnicodeDecodeError: + print(f"Error decoding integration failure log for" + f" {repo.proposal.change_id if repo else ''} at {log_url}") + return "" if repo: print(f"Found integration failure log for {repo.proposal.change_id}") else: -- cgit v1.2.3