mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix strftime on python3
This commit is contained in:
parent
c32b7daafa
commit
45975b0c39
@ -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…
x
Reference in New Issue
Block a user