Add error handling for UnicodeDecodeError
This commit is contained in:
parent
59b378e29a
commit
eb03f79978
@ -65,9 +65,12 @@ class _QtFIFOReader(QObject):
|
|||||||
"""(Try to) read a line from the FIFO."""
|
"""(Try to) read a line from the FIFO."""
|
||||||
log.procs.debug("QSocketNotifier triggered!")
|
log.procs.debug("QSocketNotifier triggered!")
|
||||||
self._notifier.setEnabled(False)
|
self._notifier.setEnabled(False)
|
||||||
for line in self._fifo:
|
try:
|
||||||
self.got_line.emit(line.rstrip('\r\n'))
|
for line in self._fifo:
|
||||||
self._notifier.setEnabled(True)
|
self.got_line.emit(line.rstrip('\r\n'))
|
||||||
|
self._notifier.setEnabled(True)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
log.misc.error("Invalid unicode in userscript output")
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Clean up so the FIFO can be closed."""
|
"""Clean up so the FIFO can be closed."""
|
||||||
|
Loading…
Reference in New Issue
Block a user