summaryrefslogtreecommitdiff
path: root/lib/extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extras.py')
-rw-r--r--lib/extras.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 7fc853a..b59a2c7 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -395,6 +395,8 @@ class LoggingConnection(_connection):
def _logtofile(self, msg, curs):
msg = self.filter(msg, curs)
if msg:
+ if _sys.version_info[0] >= 3 and isinstance(msg, bytes):
+ msg = msg.decode(_ext.encodings[self.encoding], 'replace')
self._logobj.write(msg + _os.linesep)
def _logtologger(self, msg, curs):