[CPU] Improve Commit slider's handling of non-decodable characters (#20149)

This commit is contained in:
Ivan Novoselov 2023-10-13 08:51:54 +01:00 committed by GitHub
parent b7b5d4cd93
commit 157041e6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,14 +191,10 @@ def runCommandList(commit, cfgData, enforceClean=False):
)
proc = subprocess.Popen(
formattedCmd, cwd=cwd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
stderr=subprocess.STDOUT,
encoding="utf-8", errors="replace"
)
for line in proc.stdout:
# decode if line is byte-type
try:
line = line.decode("utf-8")
except (UnicodeDecodeError, AttributeError):
pass
sys.stdout.write(line)
commitLogger.info(line)
if "catchMsg" in cmd: