mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-03-16 13:28:04 +01:00
localization.get_date() was failing with unicode characters under Python 2.
Fixed by adding a simple decode call.
This commit is contained in:
parent
8c464fddd4
commit
eed6d0debf
1 changed files with 6 additions and 1 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue