From d581a5081f802fd9c242096616654d33af93e12d Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 9 May 2022 21:29:37 -0700 Subject: [PATCH] correctly handle bytes strings in hints --- archivebox/logging_util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index e2403850..542e2b78 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -432,7 +432,9 @@ def log_archive_method_finished(result: "ArchiveResult"): # Prettify error output hints string and limit to five lines hints = getattr(result.output, 'hints', None) or () if hints: - if not isinstance(hints, (list, tuple)): + if isinstance(hints, (list, tuple)): + hints = (hint.decode() for hint in hints if isinstance(hint, bytes)) + else: if isinstance(hints, bytes): hints = hints.decode() hints = hints.split('\n')