[oe-commits] [openembedded-core] 13/24: qemurunner: convert data when working with socket

git at git.openembedded.org git at git.openembedded.org
Sun May 22 15:12:54 UTC 2016


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

commit a6eb54023d88760b7a4ae4d83427aae0d33d2116
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Mon May 16 18:40:39 2016 +0300

    qemurunner: convert data when working with socket
    
    Converted str to bytes before sending to socket.
    Converted bytes to str after receiving from socket.
    
    This should fix TypeError: 'str' does not support the buffer interface
    for qemurunner.run_serial method.
    
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/qemurunner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 773cf58..e408fbb 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -378,14 +378,14 @@ class QemuRunner:
 
         data = ''
         status = 0
-        self.server_socket.sendall(command)
+        self.server_socket.sendall(command.encode('utf-8'))
         keepreading = True
         while keepreading:
             sread, _, _ = select.select([self.server_socket],[],[],5)
             if sread:
                 answer = self.server_socket.recv(1024)
                 if answer:
-                    data += answer
+                    data += answer.decode('utf-8')
                     # Search the prompt to stop
                     if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
                         keepreading = False

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


More information about the Openembedded-commits mailing list