提交 5a32a97a 编写于 作者: L Lukáš Doktor

avocado.core.html: Skip file on UnicodeDecodeError

Users have reported failures of `lspci -vvnn` to be undecodable by
utf-8. Let's only log the failure and leave it up to the user to locate
the file on the disk.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 1cd616c4
......@@ -182,9 +182,9 @@ class ReportModel(object):
sysinfo_dict['contents'] = sysinfo_file.read()
sysinfo_dict['element_id'] = '%s_heading_%s' % (phase, s_id)
sysinfo_dict['collapse_id'] = '%s_collapse_%s' % (phase, s_id)
except OSError:
sysinfo_dict[s_f] = ('Error reading sysinfo file %s' %
sysinfo_path)
except (OSError, UnicodeDecodeError) as details:
sysinfo_dict[s_f] = ('Error reading sysinfo file %s: %s' %
(sysinfo_path, details))
sysinfo_list.append(sysinfo_dict)
s_id += 1
return sysinfo_list
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册