mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-28 08:03:25 +02:00
Fix #3172 (Viewer crashes when opening LIT book)
This commit is contained in:
parent
1ec6a278e7
commit
cdadad159f
2 changed files with 2 additions and 7 deletions
|
|
@ -174,13 +174,6 @@ def main(args=sys.argv):
|
|||
elif opts.command:
|
||||
sys.argv = args[:1]
|
||||
exec opts.command
|
||||
elif opts.exec_file:
|
||||
sys.argv = args
|
||||
base = os.path.dirname(os.path.abspath(opts.exec_file))
|
||||
sys.path.insert(0, base)
|
||||
g = globals()
|
||||
g['__name__'] = '__main__'
|
||||
execfile(opts.exec_file, g)
|
||||
elif opts.debug_device_driver:
|
||||
debug_device_driver()
|
||||
elif opts.migrate:
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ def _read_opf(self):
|
|||
except etree.XMLSyntaxError:
|
||||
data = re.sub(r'(?is)<tours>.+</tours>', '', data)
|
||||
self.logger.warn('OPF contains invalid tours section')
|
||||
data = data.replace('<dc-metadata>',
|
||||
'<dc-metadata xmlns:dc="http://purl.org/metadata/dublin_core">')
|
||||
opf = etree.fromstring(data)
|
||||
|
||||
ns = namespace(opf.tag)
|
||||
|
|
|
|||
Loading…
Reference in a new issue