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. (From OE-Core rev: 210e290c9251839dc74e3aabdcea3655dd707a50) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
aa10d71aee
commit
63404baadb
|
@ -376,14 +376,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
|
||||
|
|
Loading…
Reference in New Issue