Changes.get_latest_author_by_email() was broken under Python 3.

This is because of the patch committed with revision 68a6e90228. As
Python 3 stores unicode strings by default, we need to convert them back.

This change will hopefully fix it once and for all.
This commit is contained in:
Adam Waldenberg 2014-12-18 04:30:04 +01:00
parent eed6d0debf
commit 1230fcf80c
1 changed files with 4 additions and 0 deletions

View File

@ -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]