Commit 2f7958e4 authored by Ehsan Azarnasab's avatar Ehsan Azarnasab

decode process output as latin-1 for Python3 to also work

parent fd75d43e
...@@ -128,6 +128,7 @@ def enqueue_output(out, queue): ...@@ -128,6 +128,7 @@ def enqueue_output(out, queue):
def _log_buf(buf): def _log_buf(buf):
if not buf: if not buf:
return return
buf = buf.decode("latin-1")
buf = buf.rstrip() buf = buf.rstrip()
lines = buf.splitlines() lines = buf.splitlines()
for line in lines: for line in lines:
...@@ -158,7 +159,7 @@ def run_process(cmds, timeout=None): ...@@ -158,7 +159,7 @@ def run_process(cmds, timeout=None):
try: try:
buf = q.get(timeout=.1) buf = q.get(timeout=.1)
except Empty: except Empty:
buf = '' buf = b''
_log_buf(buf) _log_buf(buf)
elapsed = time.time() - _time elapsed = time.time() - _time
if timeout and elapsed > timeout: if timeout and elapsed > timeout:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment