2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-18 16:06:30 +08:00

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

View File

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