From 4467f91cbfef9f57af5a29d8888555db680714d0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 29 Feb 2016 22:21:10 +0800 Subject: [PATCH] coredevice: do not give up on UTF-8 errors in log. Closes #300 --- artiq/coredevice/comm_generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_generic.py b/artiq/coredevice/comm_generic.py index b4059fdcc..f4e1d2eee 100644 --- a/artiq/coredevice/comm_generic.py +++ b/artiq/coredevice/comm_generic.py @@ -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)