Replace decoder rising exception to replace unrecognised characters
+import codecs
+
__author__ = 'Michal Ernst, Marcin Usielski'
__copyright__ = 'Copyright (C) 2018, Nokia'
__email__ = 'michal.ernst@nokia.com, marcin.usielski@nokia.com'
@@ -51,6 +53,7 @@ class ThreadedTerminal(IOConnection):
"""Open ThreadedTerminal connection & start thread pulling data from it."""
if not self._terminal:
self._terminal = PtyProcessUnicode.spawn(self._cmd, dimensions=self.dimensions)
+ self._terminal.decoder = codecs.getincrementaldecoder('utf-8')(errors='replace')
done = Event()
self.pulling_thread = TillDoneThread(target=self.pull_data,
