mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Type of exception raised has changed leading to corrupt trailing data becoming unrecoverable. Fixes #1994103 [[Bug] mobi convert TypeError: ord() expected a character, but string of length 0 found](https://bugs.launchpad.net/calibre/+bug/1994103)
This commit is contained in:
parent
5be5d2fe09
commit
c143ece70c
@ -782,7 +782,7 @@ class MobiReader:
|
|||||||
if flags & 1:
|
if flags & 1:
|
||||||
try:
|
try:
|
||||||
num += sizeof_trailing_entry(data, size - num)
|
num += sizeof_trailing_entry(data, size - num)
|
||||||
except IndexError:
|
except (IndexError, TypeError):
|
||||||
self.warn_about_trailing_entry_corruption()
|
self.warn_about_trailing_entry_corruption()
|
||||||
return 0
|
return 0
|
||||||
flags >>= 1
|
flags >>= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user