Skip to contentSkip to conversation

oeqa/qemurunner: Fix binary vs str issue

PATCH New Richard Purdie 1 participant 1 message May 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/qemurunner: Fix binary vs str issue

The recent logging changes for qemurunner showed up as errors on the autobuilder where decode couldn't be called on the returned string. Since the code returns binary data, return b'' instead of '' to match to avoid tracebacks.

One of these cases was newly added, copied from the other which has been there for a long time, always broken.

---
 meta/lib/oeqa/utils/qemurunner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/utils/qemurunner.py +2 -2
index 69fee27511f..899152c7adc 100644
@@ -724,7 +724,7 @@ class LoggingThread(threading.Thread):
             data = self.readsock.recv(count)
         except socket.error as e:
             if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
-                return ''
+                return b''
             else:
                 raise
 
@@ -737,7 +737,7 @@ class LoggingThread(threading.Thread):
             # until qemu exits.
             if not self.canexit:
                 raise Exception("Console connection closed unexpectedly")
-            return ''
+            return b''
 
         return data
 
Signature · 1 line
2.30.2