mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
py3: Fix strftime on python3
This commit is contained in:
parent
c32b7daafa
commit
45975b0c39
1 changed files with 3 additions and 1 deletions
|
|
@ -550,7 +550,9 @@ def strftime(fmt, t=None):
|
|||
fmt = fmt.replace(u'%e', u'%#d')
|
||||
ans = plugins['winutil'][0].strftime(fmt, t)
|
||||
else:
|
||||
ans = time.strftime(fmt, t).decode(preferred_encoding, 'replace')
|
||||
ans = time.strftime(fmt, t)
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode(preferred_encoding, 'replace')
|
||||
if early_year:
|
||||
ans = ans.replace(u'_early year hack##', unicode_type(orig_year))
|
||||
return ans
|
||||
|
|
|
|||
Loading…
Reference in a new issue