From decab91ea239f4783cb91b42557d3c98f7d0078c Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Thu, 16 Dec 2021 16:46:12 -0600 Subject: [PATCH] (#847) Decode error output hints to string if needed --- archivebox/logging_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index a8c4e590..e2403850 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -432,7 +432,10 @@ 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: - hints = hints if isinstance(hints, (list, tuple)) else hints.split('\n') + if not isinstance(hints, (list, tuple)): + if isinstance(hints, bytes): + hints = hints.decode() + hints = hints.split('\n') hints = ( ' {}{}{}'.format(ANSI['lightyellow'], line.strip(), ANSI['reset']) for line in hints[:5] if line.strip()