提交 9d5fbdf0 编写于 作者: L Lukáš Doktor

optional_plugins: Decode tree-representation in yaml_to_mux

The 'tree.tree_view' reports bytes, but the 'to_str' method is supposed
to return text. To avoid mix-matching bytes and strings let's always
decode.

It's not really necessary to differentiate between ascii/utf8 as those
are the only encodings and ascii is a subset of utf8.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 3eaa5a43
......@@ -458,7 +458,8 @@ class RemoteTestRunner(TestRunner):
try:
json_result = self._parse_json_response(result.stdout)
except:
stacktrace.log_exc_info(sys.exc_info(), logger='avocado.debug')
stacktrace.log_exc_info(sys.exc_info(),
logger='avocado.app.debug')
raise exceptions.JobError(result.stdout)
for t_dict in json_result['tests']:
......
......@@ -211,7 +211,8 @@ class MuxPlugin(object):
# summary == 0 means disable, but in plugin it's brief
tree_repr = tree.tree_view(self.root, verbose=summary - 1,
use_utf8=kwargs.get("use_utf8", None))
out.append(tree_repr)
# ascii is a subset of UTF-8, let's use always UTF-8 to decode here
out.append(tree_repr.decode('utf-8'))
out.append("")
if variants:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册