Commit 9806e747 authored by Lucas Bates's avatar Lucas Bates Committed by Greg Kroah-Hartman

tc-testing: tdc.py: ignore errors when decoding stdout/stderr

[ Upstream commit 5aaf6428 ]

Prevent exceptions from being raised while decoding output
from an executed command. There is no impact on tdc's
execution and the verify command phase would fail the pattern
match.
Signed-off-by: default avatarLucas Bates <lucasb@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b8c51924
...@@ -134,9 +134,9 @@ def exec_cmd(args, pm, stage, command): ...@@ -134,9 +134,9 @@ def exec_cmd(args, pm, stage, command):
(rawout, serr) = proc.communicate() (rawout, serr) = proc.communicate()
if proc.returncode != 0 and len(serr) > 0: if proc.returncode != 0 and len(serr) > 0:
foutput = serr.decode("utf-8") foutput = serr.decode("utf-8", errors="ignore")
else: else:
foutput = rawout.decode("utf-8") foutput = rawout.decode("utf-8", errors="ignore")
proc.stdout.close() proc.stdout.close()
proc.stderr.close() proc.stderr.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment