From cec5fab9b3ea60bf292a6aaa5fde488cc4876743 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 6 Apr 2022 12:14:53 -0700 Subject: [PATCH] test-runner: allow decode failure when writing IO If this fails, e.g. an invalid utf-8 character it should not cause the test to fail. --- tools/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/utils.py b/tools/utils.py index be4c8638..55db4227 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -168,7 +168,10 @@ class Process(subprocess.Popen): if not data: return True - data = data.decode('utf-8') + try: + data = data.decode('utf-8') + except: + return True # Save data away in case the caller needs it (e.g. list_sta) self.out += data