mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-17 20:01:44 +02:00
correctly handle bytes strings in hints
This commit is contained in:
@@ -432,7 +432,9 @@ def log_archive_method_finished(result: "ArchiveResult"):
|
|||||||
# Prettify error output hints string and limit to five lines
|
# Prettify error output hints string and limit to five lines
|
||||||
hints = getattr(result.output, 'hints', None) or ()
|
hints = getattr(result.output, 'hints', None) or ()
|
||||||
if hints:
|
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):
|
if isinstance(hints, bytes):
|
||||||
hints = hints.decode()
|
hints = hints.decode()
|
||||||
hints = hints.split('\n')
|
hints = hints.split('\n')
|
||||||
|
Reference in New Issue
Block a user