[oe-commits] [openembedded-core] 36/40: core/target/ssh.py: replace decode errors

git at git.openembedded.org git at git.openembedded.org
Tue Aug 22 19:00:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 0d734d4d92bf61ffa87873fe477b358670320589
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Mon Aug 21 18:23:10 2017 -0700

    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]
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/core/target/ssh.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index b80939c..a2eafcd 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):
                             process.stdout.close()
                             eof = True
                         else:
-                            data = data.decode("utf-8")
+                            data = data.decode("utf-8", errors='replace')
                             output += data
                             logger.debug('Partial data from SSH call: %s' % data)
                             endtime = time.time() + timeout
@@ -233,7 +233,7 @@ def SSHCall(command, logger, timeout=None, **opts):
                 output += lastline
 
         else:
-            output = process.communicate()[0].decode("utf-8")
+            output = process.communicate()[0].decode("utf-8", errors='replace')
             logger.debug('Data from SSH call: %s' % output.rstrip())
 
     options = {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list