From 8460c7a8d93f36d1eb091b0624b0868593299d8a Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 9 May 2014 10:45:01 -0500 Subject: [PATCH] Force log lines to be interpreted as UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Any invalid UTF-8 byte will be replaced with a Unicode replacement character: U+FFFD or '�' Signed-off-by: Zack Cerza --- teuthology/orchestra/run.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 547b8cadd3b12..9d72ed628da1e 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -123,6 +123,8 @@ def copy_to_log(f, logger, host, loglevel=logging.INFO): # api for now for line in f.xreadlines(): line = line.rstrip() + # Second part of work-around for http://tracker.ceph.com/issues/8313 + line = unicode(line, 'utf-8', 'replace').encode('utf-8') logger.log(loglevel, '[' + host + ']: ' + line) def copy_and_close(src, fdst): -- 2.39.5