[Fuego] [PATCH 4/8] Use decode() to convert bytes to string in python3

[email protected] Wed, 20 Apr 2022 15:41:36 +0530
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
From: Shivanand Kunijadar <[email protected]>

The file read operation in python3 converts data to bytes.
Use decode() to convert bytes to string in python3 which is
compatible with python2 and python3.

Signed-off-by: Shivanand Kunijadar <[email protected]>
---
 scripts/ftc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/ftc b/scripts/ftc
index ce34b08..3723e7e 100755
--- a/scripts/ftc
+++ b/scripts/ftc
@@ -3960,7 +3960,7 @@ def ftc_exec_command(command, timeout):
             log.flush()
             data = os.read(tail_fd, 4096)
             if data:
-                sys.stdout.write(data)
+                sys.stdout.write(data.decode("utf8"))
                 sys.stdout.flush()
 
             time.sleep(.1)
@@ -4813,7 +4813,7 @@ def do_run_test(conf, options):
     # drain the log, in case there's more there
     data = os.read(tail_fd, 4096)
     while data:
-        sys.stdout.write(data)
+        sys.stdout.write(data.decode("utf8"))
         data = os.read(tail_fd, 4096)
 
     # record success or failure
-- 
2.20.1