From 98076482b69e237b20de6ec5f68c2d9cbf91c717 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 17 Feb 2014 16:01:31 +0000 Subject: [PATCH] ChannelLogger: Fix Python 2 compatibility. --- plugins/ChannelLogger/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/ChannelLogger/plugin.py b/plugins/ChannelLogger/plugin.py index 097e6c25b..f107999a4 100644 --- a/plugins/ChannelLogger/plugin.py +++ b/plugins/ChannelLogger/plugin.py @@ -162,8 +162,10 @@ class ChannelLogger(callbacks.Plugin): def timestamp(self, log): format = conf.supybot.log.timestampFormat() if format: - log.write(time.strftime(format)) - log.write(' ') + string = time.strftime(format) + ' ' + if sys.version_info[0] < 3: + string = string.decode() + log.write(string) def normalizeChannel(self, irc, channel): return ircutils.toLower(channel)