From 370c7671da693aeb3dce730694b4d0ea2e63c554 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 16 Sep 2012 22:48:48 +0200 Subject: tracking: Convert all outgoing unicode objects to str. --- modules/tracking.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/tracking.py b/modules/tracking.py index 1a7b300..86b59b7 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -383,9 +383,13 @@ class Module: if msg: if type(msg) == list: for i in msg: - self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], i.encode('utf-8')) + if isinstance(i, unicode): + i = i.encode('utf-8') + self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], i) else: - self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], msg.encode('utf-8')) + if isinstance(msg, unicode): + msg = msg.encode('utf-8') + self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], msg) else: self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], 'No data returned (this is a bug).') -- cgit v1.2.3