From 1230fcf80cd90410fa0351db8179d02bb2b2bf7b Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Thu, 18 Dec 2014 04:30:04 +0100 Subject: [PATCH] Changes.get_latest_author_by_email() was broken under Python 3. This is because of the patch committed with revision 68a6e902284a. As Python 3 stores unicode strings by default, we need to convert them back. This change will hopefully fix it once and for all. --- gitinspector/changes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitinspector/changes.py b/gitinspector/changes.py index 675807d..2fc03cd 100644 --- a/gitinspector/changes.py +++ b/gitinspector/changes.py @@ -21,6 +21,7 @@ from __future__ import print_function from __future__ import unicode_literals from localization import N_ from outputable import Outputable +import codecs import datetime import extensions import filtering @@ -179,6 +180,9 @@ class Changes: return self.authors_dateinfo def get_latest_author_by_email(self, name): + if not hasattr(name, 'decode'): + name = str.encode(name) + name = name.decode("unicode_escape", "ignore") return self.authors_by_email[name]