From 1c6bc9c11291fffe8de9dbe88c9490ac0e2d4278 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 19 Oct 2013 07:52:53 -0400 Subject: [PATCH] Prevent a unicode error on UTF-8 in commit metadata. Having utf-8 in the commit metada (e.g author, commit message, file names) triggered a decoding error: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 42: ordinal not in range(128)" This is because the __unicode__ method of the Commit class, doesn't actually return an object of type 'unicode' although it should. --- irkerhook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irkerhook.py b/irkerhook.py index d09eb17..b622a44 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -88,7 +88,7 @@ class Commit: self.url = webview except IOError: self.url = "" - return self.template % self.__dict__ + return unicode(self.template % self.__dict__, "utf-8") class GenericExtractor: "Generic class for encapsulating data from a VCS." -- 2.26.2