From f461783a37efc3f4edd2aca2739b8b1714eabb54 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Feb 2011 16:21:18 -0700 Subject: [PATCH] LIT Input: Workaround LIT files generated by some broken software that sets the OPF namespace to http://openebook.org/namespaces/oeb-package/1.0. Fixes #8875 (OEBError: Invalid namespace, when opening LIT eBook in Ebookreader from Calibre) --- src/calibre/ebooks/oeb/reader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index d08a68c0bc..4a09e0b1d4 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -103,6 +103,8 @@ class OEBReader(object): data = self.oeb.container.read(None) data = self.oeb.decode(data) data = XMLDECL_RE.sub('', data) + data = data.replace('http://openebook.org/namespaces/oeb-package/1.0', + OPF1_NS) try: opf = etree.fromstring(data) except etree.XMLSyntaxError: