Fix error on decoding broken log files

This commit is contained in:
2021-06-03 21:14:18 +02:00
parent 4eec6306a9
commit 61d543e6c7
3 changed files with 3 additions and 4 deletions

View File

@@ -340,7 +340,6 @@ class DebugIos(QtWidgets.QMainWindow, Ui_win_debugios):
:param value: New value as bytes or bool for widget
:param just_last_value: Just set last value property
"""
# child = self.findChild(self.search_class, io_name)
child = self.__qwa[io_name]
if child.property("frm"):
value = struct.unpack(child.property("frm"), value)[0]

View File

@@ -44,7 +44,7 @@ class DataThread(QtCore.QThread):
:return: tuple(position: int, EOF: bool)
"""
# Load max data from start position
buff_log = xmlcall(start_position, self.max_block).data
buff_log = xmlcall(start_position, self.max_block).data # type: bytes
eof = True
if buff_log == b'\x16': # 'ESC'
@@ -59,7 +59,7 @@ class DataThread(QtCore.QThread):
elif buff_log:
start_position += len(buff_log)
eof = len(buff_log) < self.max_block
self.line_logged.emit(log_type, True, buff_log.decode("utf-8"))
self.line_logged.emit(log_type, True, buff_log.decode("utf-8", errors="replace"))
return start_position, eof

View File

@@ -19,7 +19,7 @@ class MyEggInfo(distutils.command.install_egg_info.install_egg_info):
setup(
version="0.9.2",
version="0.9.2a",
python_requires="~=3.4",
requires=["PyQt5", "revpimodio2", "zeroconf"],