Bugfix with encoding errors windows

This commit is contained in:
Ozzie Isaacs 2021-07-11 07:38:15 +02:00
parent f8de7e75cc
commit 1bf065fd04

View File

@ -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