PY3: decode subprocess output if it's bytes
Otherwise, the logger will cause errors for the output. Change-Id: I4379dba7629cfc0d928c1adda587ca400a38d227
This commit is contained in:
parent
89fd96b9ff
commit
c72226b654
@ -319,8 +319,12 @@ class RunTimeSandbox(object):
|
||||
stdout, stderr = proc.communicate()
|
||||
|
||||
if stdout:
|
||||
if not isinstance(stdout, str):
|
||||
stdout = stdout.decode("utf-8")
|
||||
self.logger.debug('STDOUT: %s' % stdout.replace('\n', '#012'))
|
||||
if stderr:
|
||||
if not isinstance(stderr, str):
|
||||
stderr = stderr.decode("utf-8")
|
||||
self.logger.error('STDERR: %s' % stderr.replace('\n', '#012'))
|
||||
|
||||
if proc.returncode:
|
||||
|
Loading…
Reference in New Issue
Block a user