From 94e984b88a60fd146951a7e798573c503aafaf43 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 7 Aug 2019 00:22:44 +0200 Subject: Encoding/decoding non-ASCII OS errors in GUI log handler --- jfr_playoff/gui/logframe.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'jfr_playoff') diff --git a/jfr_playoff/gui/logframe.py b/jfr_playoff/gui/logframe.py index 74ffca1..078226e 100644 --- a/jfr_playoff/gui/logframe.py +++ b/jfr_playoff/gui/logframe.py @@ -62,6 +62,8 @@ class LogWindow(tk.Toplevel): def addRecord(self, record): self._counter += 1 self._records.append((record, datetime.datetime.now())) + if not isinstance(record.message, unicode): + record.message = unicode(record.message, errors='replace') self.logList.insert( '', tk.END, tag=self._counter, values=[ record.levelname, record.name, record.message -- cgit v1.2.3