From: Laurent Bachelier Date: Sun, 1 Dec 2013 19:13:23 +0000 (+0100) Subject: Only convert to unicode when needed X-Git-Tag: 2.4~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=113cc218f82571cf07956c7ac0e75f039729eb83;p=irker.git Only convert to unicode when needed Otherwise, it would crash if any unicode string was already present. Signed-off-by: Eric S. Raymond --- diff --git a/irkerhook.py b/irkerhook.py index 35f305a..c7c7b0d 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -88,7 +88,8 @@ class Commit: self.url = webview except IOError: self.url = "" - return unicode(self.template % self.__dict__, "utf-8") + res = self.template % self.__dict__ + return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res class GenericExtractor: "Generic class for encapsulating data from a VCS."