From: Richard Purdie Date: Sun, 12 May 2019 18:49:25 +0000 (+0100) Subject: oeqa/target/ssh: Replace suggogatepass with ignoring errors X-Git-Tag: 2018-10.4-thud~102 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=cf4d3230ac439118a2ad3c381bac38e11b3e14e8;p=openembedded-core.git oeqa/target/ssh: Replace suggogatepass with ignoring errors We continued to see encoding problems with ssh commands run in oeqa. After much research the conclusion was we should use ignore the errors since some occasional bad locale encoding is better than the unicode decoding issues we were seeing which crashed large parts of tests. Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster --- diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py index 2adbb3000c..0c09ddf518 100644 --- a/meta/lib/oeqa/core/target/ssh.py +++ b/meta/lib/oeqa/core/target/ssh.py @@ -207,7 +207,7 @@ def SSHCall(command, logger, timeout=None, **opts): logger.debug('time: %s, endtime: %s' % (time.time(), endtime)) try: if select.select([process.stdout], [], [], 5)[0] != []: - reader = codecs.getreader('utf-8')(process.stdout, 'surrogatepass') + reader = codecs.getreader('utf-8')(process.stdout, 'ignore') data = reader.read(1024, 4096) if not data: process.stdout.close() @@ -234,7 +234,7 @@ def SSHCall(command, logger, timeout=None, **opts): output += lastline else: - output = process.communicate()[0].decode("utf-8", errors='surrogatepass') + output = process.communicate()[0].decode('utf-8', errors='ignore') logger.debug('Data from SSH call: %s' % output.rstrip()) options = {