Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] core/target/ssh.py: use reader to handle partial data
@ 2017-08-24  6:19 Robert Yang
  2017-08-24  6:19 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2017-08-24  6:19 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit dcb6cd19fb8c639cb844d116fb83827267f37421:

  buildhistory.bbclass: add ptest (2017-08-23 14:12:39 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/ptest
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/ptest

Robert Yang (1):
  core/target/ssh.py: use reader to handle partial data

 meta/lib/oeqa/core/target/ssh.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.10.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] core/target/ssh.py: use reader to handle partial data
  2017-08-24  6:19 [PATCH 0/1] core/target/ssh.py: use reader to handle partial data Robert Yang
@ 2017-08-24  6:19 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2017-08-24  6:19 UTC (permalink / raw)
  To: openembedded-core

This can avoid UnicodeDecodeError error.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/lib/oeqa/core/target/ssh.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index a2eafcd..927d659 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -6,6 +6,7 @@ import time
 import select
 import logging
 import subprocess
+import codecs
 
 from . import OETarget
 
@@ -206,12 +207,12 @@ def SSHCall(command, logger, timeout=None, **opts):
                 logger.debug('time: %s, endtime: %s' % (time.time(), endtime))
                 try:
                     if select.select([process.stdout], [], [], 5)[0] != []:
-                        data = os.read(process.stdout.fileno(), 1024)
+                        reader = codecs.getreader('utf-8')(process.stdout)
+                        data = reader.read(1024, 1024)
                         if not data:
                             process.stdout.close()
                             eof = True
                         else:
-                            data = data.decode("utf-8", errors='replace')
                             output += data
                             logger.debug('Partial data from SSH call: %s' % data)
                             endtime = time.time() + timeout
-- 
2.10.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-24  6:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24  6:19 [PATCH 0/1] core/target/ssh.py: use reader to handle partial data Robert Yang
2017-08-24  6:19 ` [PATCH 1/1] " Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox