From 6363aaa5b9894d5aad3720eebbeef1275ba6e7d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 May 2010 12:44:15 -0600 Subject: [PATCH] Raise an appropriate error for DTBook EPUB files --- src/calibre/ebooks/epub/input.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/ebooks/epub/input.py b/src/calibre/ebooks/epub/input.py index 5c4e255177..0abb8f49de 100644 --- a/src/calibre/ebooks/epub/input.py +++ b/src/calibre/ebooks/epub/input.py @@ -146,6 +146,10 @@ class EPUBInput(InputFormatPlugin): self.rationalize_cover(opf, log) self.optimize_opf_parsing = opf + for x in opf.itermanifest(): + if x.get('media-type', '') == 'application/x-dtbook+xml': + raise ValueError( + 'EPUB files with DTBook markup are not supported') with open('content.opf', 'wb') as nopf: nopf.write(opf.render())