mirror of
https://github.com/naruxde/revpicommander.git
synced 2025-11-08 16:43:53 +01:00
Fix error on decoding broken log files
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user