[CPU] Improve Commit slider's handling of non-decodable characters (#20149)
This commit is contained in:
parent
b7b5d4cd93
commit
157041e6f8
@ -191,14 +191,10 @@ def runCommandList(commit, cfgData, enforceClean=False):
|
|||||||
)
|
)
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
formattedCmd, cwd=cwd, stdout=subprocess.PIPE,
|
formattedCmd, cwd=cwd, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT
|
stderr=subprocess.STDOUT,
|
||||||
|
encoding="utf-8", errors="replace"
|
||||||
)
|
)
|
||||||
for line in proc.stdout:
|
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)
|
sys.stdout.write(line)
|
||||||
commitLogger.info(line)
|
commitLogger.info(line)
|
||||||
if "catchMsg" in cmd:
|
if "catchMsg" in cmd:
|
||||||
|
Loading…
Reference in New Issue
Block a user