mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:53:27 +02:00
Fix crash when using %e with strftime on windows
Fixes #1206705 [strftime crashes under Windows with %e](https://bugs.launchpad.net/calibre/+bug/1206705)
This commit is contained in:
parent
1d9a3dcb5f
commit
1e163cbe10
1 changed files with 1 additions and 0 deletions
|
|
@ -509,6 +509,7 @@ def strftime(fmt, t=None):
|
|||
if iswindows:
|
||||
if isinstance(fmt, unicode):
|
||||
fmt = fmt.encode('mbcs')
|
||||
fmt = fmt.replace(b'%e', b'%#d')
|
||||
ans = plugins['winutil'][0].strftime(fmt, t)
|
||||
else:
|
||||
ans = time.strftime(fmt, t).decode(preferred_encoding, 'replace')
|
||||
|
|
|
|||
Loading…
Reference in a new issue