From 21c6e3e907972faa0c4aaef7a9dc62db17de8e09 Mon Sep 17 00:00:00 2001 From: Thiago de Oliveira Pereira Date: Sat, 19 Dec 2020 11:04:39 -0300 Subject: [PATCH] Fix removal of toc reference in spine element - Don't remove toc property from spine element, when keeping the NCX file --- src/calibre/ebooks/oeb/polish/upgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/upgrade.py b/src/calibre/ebooks/oeb/polish/upgrade.py index 44a01429bc..0aac8aaadb 100644 --- a/src/calibre/ebooks/oeb/polish/upgrade.py +++ b/src/calibre/ebooks/oeb/polish/upgrade.py @@ -121,7 +121,7 @@ def epub_2_to_3(container, report, previous_nav=None, remove_ncx=True): toc_name = find_existing_ncx_toc(container) if toc_name and remove_ncx: container.remove_item(toc_name) - container.opf_xpath('./opf:spine')[0].attrib.pop('toc', None) + container.opf_xpath('./opf:spine')[0].attrib.pop('toc', None) landmarks = get_landmarks(container) for guide in container.opf_xpath('./opf:guide'): guide.getparent().remove(guide)