From 1bf065fd04fa809de35854d6d5aded200e56966d Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 11 Jul 2021 07:38:15 +0200 Subject: [PATCH] Bugfix with encoding errors windows --- cps/subproc_wrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cps/subproc_wrapper.py b/cps/subproc_wrapper.py index 27375686..3cc4a070 100644 --- a/cps/subproc_wrapper.py +++ b/cps/subproc_wrapper.py @@ -52,10 +52,11 @@ def process_wait(command, serr=subprocess.PIPE, pattern=""): p.wait() for line in p.stdout.readlines(): if isinstance(line, bytes): - line = line.decode('utf-8') + line = line.decode('utf-8', errors="ignore") match = re.search(pattern, line, re.IGNORECASE) if match and ret_val == "": ret_val = match + break p.stdout.close() p.stderr.close() return ret_val