1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

utils/android: LogcatMonitor: put pexpect.spawn() in str mode

By default, pexpect.spawn() is a bytes interface: its read methods
return bytes and its write/send and expect method expect bytes. Logcat
uses utf-8 strings, so put pexpect.spawn() in str mode.

This code can't have worked in python3 before, since the logcat file
is not opened in "b" mode.
This commit is contained in:
Javi Merino 2020-04-16 15:19:20 +01:00 committed by Marc Bonnici
parent 7c8573a416
commit 3709e06b5c

View File

@ -753,7 +753,7 @@ class LogcatMonitor(object):
logcat_cmd = get_adb_command(self.target.conn.device, logcat_cmd)
logger.debug('logcat command ="{}"'.format(logcat_cmd))
self._logcat = pexpect.spawn(logcat_cmd, logfile=self._logfile)
self._logcat = pexpect.spawn(logcat_cmd, logfile=self._logfile, encoding='utf-8')
def stop(self):
self._logcat.terminate()