提交 f87561b3 编写于 作者: C Cleber Rosa

scripts/avocado: give bytes to os.write() instead of string

Python 3 is more strict about I/O to files not openend in text
mode. Let's encode the message in utf-8 and have bytes written
to the traceback log file.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 884a5cf4
......@@ -45,7 +45,7 @@ def handle_exception(*exc_info):
except:
pass
tmp, name = tempfile.mkstemp(".log", prefix, crash_dir)
os.write(tmp, msg)
os.write(tmp, msg.encode('utf-8'))
os.close(tmp)
# Print friendly message in console-like output
msg = ("Avocado crashed unexpectedly: %s\nYou can find details in %s"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册