interactive: correctly load non-ascii logs

Some packages write utf-8 in logs, and may write
build logs in other charset. Now we can load
such logs more or less correctly.
This commit is contained in:
Ivan A. Melnikov 2019-01-22 13:03:49 +04:00
parent 7a656153fc
commit 530010dee9

View File

@ -188,7 +188,7 @@ def fti(num, to=print):
def logs(num, idx=-1, to=pager):
log_file = m_logs.task_event_logs(get_task(num, TASKS))[idx]
with open(log_file, 'r') as f:
log = f.read()
log = f.read().decode('utf-8', errors='replace')
to(log_file + ':\n\n' + log)