From f28ee6867999316fcc9dbe3c2f46d3475bd5feae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 May 2014 20:28:32 +0530 Subject: [PATCH] Edit Book: Fix error in the Check Book tool when items in the opf have paths starting with a leading slash. Fixes #1319378 [Error in content.opf causes ebook editor checking to fail](https://bugs.launchpad.net/calibre/+bug/1319378) --- src/calibre/ebooks/oeb/polish/check/opf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/check/opf.py b/src/calibre/ebooks/oeb/polish/check/opf.py index 03d7702825..e3c3e66101 100644 --- a/src/calibre/ebooks/oeb/polish/check/opf.py +++ b/src/calibre/ebooks/oeb/polish/check/opf.py @@ -215,7 +215,8 @@ def check_opf(container): seen, dups = {}, {} for item in container.opf_xpath('/opf:package/opf:manifest/opf:item[@href]'): href = item.get('href') - if not container.exists(container.href_to_name(href, container.opf_name)): + hname = container.href_to_name(href, container.opf_name) + if not hname or not container.exists(hname): errors.append(MissingHref(container.opf_name, href, item.sourceline)) if href in seen: if href not in dups: