mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: more fixes
This commit is contained in:
parent
5e7c625685
commit
69ea54fa15
@ -498,6 +498,7 @@ def strftime(fmt, t=None):
|
|||||||
t = list(t)
|
t = list(t)
|
||||||
orig_year = t[0]
|
orig_year = t[0]
|
||||||
t[0] = replacement
|
t[0] = replacement
|
||||||
|
t = time.struct_time(t)
|
||||||
ans = None
|
ans = None
|
||||||
if iswindows:
|
if iswindows:
|
||||||
if isinstance(fmt, bytes):
|
if isinstance(fmt, bytes):
|
||||||
|
@ -38,7 +38,7 @@ class APNXBuilder(object):
|
|||||||
|
|
||||||
with lopen(mobi_file_path, 'rb') as mf:
|
with lopen(mobi_file_path, 'rb') as mf:
|
||||||
ident = PdbHeaderReader(mf).identity()
|
ident = PdbHeaderReader(mf).identity()
|
||||||
if ident != b'BOOKMOBI':
|
if as_bytes(ident) != b'BOOKMOBI':
|
||||||
# Check that this is really a MOBI file.
|
# Check that this is really a MOBI file.
|
||||||
raise Exception(_('Not a valid MOBI file. Reports identity of %s') % ident)
|
raise Exception(_('Not a valid MOBI file. Reports identity of %s') % ident)
|
||||||
apnx_meta['acr'] = as_unicode(PdbHeaderReader(mf).name(), errors='replace')
|
apnx_meta['acr'] = as_unicode(PdbHeaderReader(mf).name(), errors='replace')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user