diff --git a/lib/extras.py b/lib/extras.py index 798b3d2b..7ee52c75 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -455,6 +455,8 @@ class MinTimeLoggingConnection(LoggingConnection): def filter(self, msg, curs): t = (_time.time() - curs.timestamp) * 1000 if t > self._mintime: + if _sys.version_info[0] >= 3 and isinstance(msg, bytes): + msg = msg.decode(_ext.encodings[self.encoding], 'replace') return msg + _os.linesep + " (execution time: %d ms)" % t def cursor(self, *args, **kwargs):