1
0
Fork 0
mirror of synced 2024-06-12 23:44:40 +12:00

(#847) Decode error output hints to string if needed

This commit is contained in:
TheCakeIsNaOH 2021-12-16 16:46:12 -06:00
parent b279c30b8d
commit decab91ea2
No known key found for this signature in database
GPG key ID: 32DE8798F3AEC13D

View file

@ -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()