From fcea36f7d657fb9d49b66890490bf2199e3a9d16 Mon Sep 17 00:00:00 2001 From: lq Date: Tue, 28 Apr 2020 18:53:18 +0800 Subject: [PATCH] Let `subprocess.Popen` open outputs in text mode (#629) Co-authored-by: Qiang Li --- tools/device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/device.py b/tools/device.py index 55cf3a75..9ec9edf4 100644 --- a/tools/device.py +++ b/tools/device.py @@ -243,7 +243,8 @@ class DeviceWrapper: "--model_file=%s" % mace_model_path, ], stderr=subprocess.PIPE, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + universal_newlines=True) out, err = p.communicate() self.stdout = err + out six.print_(self.stdout) -- GitLab