[OE-core] [PATCH] oeqa/target/ssh: Replace suggogatepass with latin-1 codec

akuster808 akuster808 at gmail.com
Mon May 13 20:16:46 UTC 2019



On 5/13/19 4:29 AM, Richard Purdie wrote:
> We continued to see encoding problems with ssh commands run in oeqa. After much
> research the conclusion was we should use the latin-1 coding which would avoid
> the problems.
There are hard coded encodings in may places. Would a variable be
applicable in this case?

- armin

>
> 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 cf3d44d12d5..3dee03385d2 100644
> --- a/meta/lib/oeqa/core/target/ssh.py
> +++ b/meta/lib/oeqa/core/target/ssh.py
> @@ -210,7 +210,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('latin-1')(process.stdout)
>                          data = reader.read(1024, 4096)
>                          if not data:
>                              process.stdout.close()
> @@ -237,7 +237,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('latin-1')
>              logger.debug('Data from SSH call: %s' % output.rstrip())
>  
>      options = {



More information about the Openembedded-core mailing list