From 5853dd1ef3c522a975f9685250b1b3e85588f738 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 25 May 2019 09:38:40 +0200 Subject: Set utf-8 in decode and encode calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It eases backporting in iruya and hunter as a few logs can't be decoded as ascii [1]. [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-vnf-iruya-juju_epc-run/56/console Change-Id: I52a6f9a25130cbf62e8ce3b9972064ab73177665 Signed-off-by: Cédric Ollivier --- functest/utils/functest_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functest/utils') diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 4bc417d61..42c1edc9b 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -43,9 +43,9 @@ def execute_command(cmd, info=False, error_msg="", ofd = open(output_file, "w") for line in iter(popen.stdout.readline, b''): if output_file: - ofd.write(line.decode()) + ofd.write(line.decode("utf-8")) else: - line = line.decode().replace('\n', '') + line = line.decode("utf-8").replace('\n', '') print(line) sys.stdout.flush() if output_file: -- cgit 1.2.3-korg