mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +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:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							7c8573a416
						
					
				
				
					commit
					3709e06b5c
				
			@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user