coredevice: do not give up on UTF-8 errors in log. Closes #300

This commit is contained in:
Sebastien Bourdeauducq 2016-02-29 22:21:10 +08:00
parent 572c49f475
commit 4467f91cbf
1 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ class CommGeneric:
return self._read_chunk(self._read_int32())
def _read_string(self):
return self._read_bytes()[:-1].decode('utf-8')
return self._read_bytes()[:-1].decode("utf-8")
#
# Writer interface
@ -242,7 +242,7 @@ class CommGeneric:
self._read_header()
self._read_expect(_D2HMsgType.LOG_REPLY)
return self._read_chunk(self._read_length).decode("utf-8")
return self._read_chunk(self._read_length).decode("utf-8", "replace")
def clear_log(self):
self._write_empty(_H2DMsgType.LOG_CLEAR)