summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Smith <daniel.smith@qt.io>2022-03-07 12:20:12 +0100
committerDaniel Smith <Daniel.Smith@qt.io>2022-03-14 11:28:30 +0000
commitd192c1e50674ec244e1c2edbbcf41479d91c30b9 (patch)
tree0b79c26f66f2121cd663511e6f44fe1c706eecc7
parent08ca9944715735726d36f7d82123dc299f73335d (diff)
downloadqtrepotools-d192c1e50674ec244e1c2edbbcf41479d91c30b9.tar.gz
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 <Daniel.Smith@qt.io>
-rw-r--r--util/dependency_updater/tools/toolbox.py7
1 files changed, 6 insertions, 1 deletions
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: