Browse Source

correctly handle bytes strings in hints

Nick Sweeting 3 years ago
parent
commit
d581a5081f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      archivebox/logging_util.py

+ 3 - 1
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')