summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-08-21 18:23:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-23 14:16:01 +0100
commit9fd9fae6349cb1be7c9708bf468d2dab7ef3e74d (patch)
tree629dc8956cdf0713fb08273e167e84513753b421 /meta
parentf4d4bfd2b7cd7e3b4ff6dcb92964b9ddb9db78af (diff)
downloadpoky-9fd9fae6349cb1be7c9708bf468d2dab7ef3e74d.tar.gz
core/target/ssh.py: replace decode errors
There might be wild strings when read from target (especially when reading ptest results), replace the errors to avoid breaking the test. Fixed: (Not always happen) $ bitbake core-image-sato -ctestimage [snip] status, output = self.target.run('ptest-runner', 0) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 84, in run status, output = self._run(sshCmd, processTimeout, True) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 55, in _run status, output = SSHCall(command, self.logger, timeout) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 258, in SSHCall run() File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 236, in run output = process.communicate()[0].decode("utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 4906: invalid continuation byte [YOCTO #11547] (From OE-Core rev: d0d2f892f0bed6adb5ec6fb59d64efcc97c83e19) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/target/ssh.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index b80939c0e5..a2eafcd6f2 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -211,7 +211,7 @@ def SSHCall(command, logger, timeout=None, **opts):
211 process.stdout.close() 211 process.stdout.close()
212 eof = True 212 eof = True
213 else: 213 else:
214 data = data.decode("utf-8") 214 data = data.decode("utf-8", errors='replace')
215 output += data 215 output += data
216 logger.debug('Partial data from SSH call: %s' % data) 216 logger.debug('Partial data from SSH call: %s' % data)
217 endtime = time.time() + timeout 217 endtime = time.time() + timeout
@@ -233,7 +233,7 @@ def SSHCall(command, logger, timeout=None, **opts):
233 output += lastline 233 output += lastline
234 234
235 else: 235 else:
236 output = process.communicate()[0].decode("utf-8") 236 output = process.communicate()[0].decode("utf-8", errors='replace')
237 logger.debug('Data from SSH call: %s' % output.rstrip()) 237 logger.debug('Data from SSH call: %s' % output.rstrip())
238 238
239 options = { 239 options = {