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 value: New value as bytes or bool for widget
|
||||||
:param just_last_value: Just set last value property
|
:param just_last_value: Just set last value property
|
||||||
"""
|
"""
|
||||||
# child = self.findChild(self.search_class, io_name)
|
|
||||||
child = self.__qwa[io_name]
|
child = self.__qwa[io_name]
|
||||||
if child.property("frm"):
|
if child.property("frm"):
|
||||||
value = struct.unpack(child.property("frm"), value)[0]
|
value = struct.unpack(child.property("frm"), value)[0]
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class DataThread(QtCore.QThread):
|
|||||||
:return: tuple(position: int, EOF: bool)
|
:return: tuple(position: int, EOF: bool)
|
||||||
"""
|
"""
|
||||||
# Load max data from start position
|
# 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
|
eof = True
|
||||||
if buff_log == b'\x16': # 'ESC'
|
if buff_log == b'\x16': # 'ESC'
|
||||||
@@ -59,7 +59,7 @@ class DataThread(QtCore.QThread):
|
|||||||
elif buff_log:
|
elif buff_log:
|
||||||
start_position += len(buff_log)
|
start_position += len(buff_log)
|
||||||
eof = len(buff_log) < self.max_block
|
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
|
return start_position, eof
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -19,7 +19,7 @@ class MyEggInfo(distutils.command.install_egg_info.install_egg_info):
|
|||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
version="0.9.2",
|
version="0.9.2a",
|
||||||
python_requires="~=3.4",
|
python_requires="~=3.4",
|
||||||
requires=["PyQt5", "revpimodio2", "zeroconf"],
|
requires=["PyQt5", "revpimodio2", "zeroconf"],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user