localization.get_date() was failing with unicode characters under Python 2.

Fixed by adding a simple decode call.
This commit is contained in:
Adam Waldenberg 2014-12-18 04:07:28 +01:00
parent 8c464fddd4
commit eed6d0debf
1 changed files with 6 additions and 1 deletions

View File

@ -67,7 +67,12 @@ def init():
def get_date():
if __enabled__ and isinstance(__translation__, gettext.GNUTranslations):
return time.strftime("%x")
date = time.strftime("%x")
if hasattr(date, 'decode'):
date = date.decode("utf-8", "replace")
return date
else:
return time.strftime("%Y/%m/%d")