From af8c47151e0b8d9b9cc71450bb61587f2c6486e0 Mon Sep 17 00:00:00 2001 From: Jonathan Paynter Date: Tue, 23 Jun 2020 17:15:43 +0100 Subject: [PATCH] utils/android: Fix inconsistent logfile read mode As the exoplayer workload did not specify a pre-existing logfile, it is created for it by default in LogcatMonitor. This default method opens the logfile in 'byte' mode rather than the expected 'string' mode. Regex operations that depend on the logfile for event triggering expect it to be in 'string' mode, which was not the case. --- devlib/utils/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/android.py b/devlib/utils/android.py index 3a978c8..4c9587d 100755 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -789,7 +789,7 @@ class LogcatMonitor(object): if outfile: self._logfile = open(outfile, 'w') else: - self._logfile = tempfile.NamedTemporaryFile() + self._logfile = tempfile.NamedTemporaryFile(mode='w') self.target.clear_logcat()