diff --git a/src/calibre/ebooks/oeb/polish/upgrade.py b/src/calibre/ebooks/oeb/polish/upgrade.py index ecd85ee2fd..d520066551 100644 --- a/src/calibre/ebooks/oeb/polish/upgrade.py +++ b/src/calibre/ebooks/oeb/polish/upgrade.py @@ -74,7 +74,10 @@ def collect_properties(container): if mt.lower() not in OEB_DOCS: continue name = container.href_to_name(item.get('href'), container.opf_name) - root = container.parsed(name) + try: + root = container.parsed(name) + except KeyError: + continue root = ensure_namespace_prefixes(root, {'epub': EPUB_NS}) properties = set() container.replace(name, root) # Ensure entities are converted