mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3172 (Viewer crashes when opening LIT book)
This commit is contained in:
parent
1ec6a278e7
commit
cdadad159f
@ -174,13 +174,6 @@ def main(args=sys.argv):
|
|||||||
elif opts.command:
|
elif opts.command:
|
||||||
sys.argv = args[:1]
|
sys.argv = args[:1]
|
||||||
exec opts.command
|
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:
|
elif opts.debug_device_driver:
|
||||||
debug_device_driver()
|
debug_device_driver()
|
||||||
elif opts.migrate:
|
elif opts.migrate:
|
||||||
|
@ -114,6 +114,8 @@ class OEBReader(object):
|
|||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
data = re.sub(r'(?is)<tours>.+</tours>', '', data)
|
data = re.sub(r'(?is)<tours>.+</tours>', '', data)
|
||||||
self.logger.warn('OPF contains invalid tours section')
|
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)
|
opf = etree.fromstring(data)
|
||||||
|
|
||||||
ns = namespace(opf.tag)
|
ns = namespace(opf.tag)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user