Fix #2024121 [[bug][convert] convert mobi to epub raise keyerror](https://bugs.launchpad.net/calibre/+bug/2024121)

This commit is contained in:
Kovid Goyal 2023-06-16 09:07:37 +05:30
parent bff8d6578b
commit 341f41b61d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -74,7 +74,10 @@ def collect_properties(container):
if mt.lower() not in OEB_DOCS: if mt.lower() not in OEB_DOCS:
continue continue
name = container.href_to_name(item.get('href'), container.opf_name) name = container.href_to_name(item.get('href'), container.opf_name)
try:
root = container.parsed(name) root = container.parsed(name)
except KeyError:
continue
root = ensure_namespace_prefixes(root, {'epub': EPUB_NS}) root = ensure_namespace_prefixes(root, {'epub': EPUB_NS})
properties = set() properties = set()
container.replace(name, root) # Ensure entities are converted container.replace(name, root) # Ensure entities are converted