Edit Book: Refuse to save EPUB files that have missing container.xml files. See #1740460 (Edit Book feature results in error after previously editing successfully)

This commit is contained in:
Kovid Goyal 2017-12-29 11:09:24 +05:30
parent 38f2b885c0
commit 2ea7fd0c52
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1296,6 +1296,10 @@ class EpubContainer(Container):
def commit(self, outpath=None, keep_parsed=False):
super(EpubContainer, self).commit(keep_parsed=keep_parsed)
container_path = join(self.root, 'META-INF', 'container.xml')
if not exists(container_path):
raise InvalidEpub('No META-INF/container.xml in EPUB, this typically happens if the temporary files calibre'
' is using are deleted by some other program while calibre is running')
restore_fonts = {}
for name in self.obfuscated_fonts:
if name not in self.name_path_map: