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)

This commit is contained in:
Kovid Goyal 2014-05-14 20:28:32 +05:30
parent 00c6b21b74
commit f28ee68679

View File

@ -215,7 +215,8 @@ def check_opf(container):
seen, dups = {}, {} seen, dups = {}, {}
for item in container.opf_xpath('/opf:package/opf:manifest/opf:item[@href]'): for item in container.opf_xpath('/opf:package/opf:manifest/opf:item[@href]'):
href = item.get('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)) errors.append(MissingHref(container.opf_name, href, item.sourceline))
if href in seen: if href in seen:
if href not in dups: if href not in dups: