mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1970171 [Failed to open book](https://bugs.launchpad.net/calibre/+bug/1970171)
This commit is contained in:
parent
78e6966dae
commit
93961cb8ab
@ -302,7 +302,10 @@ class Container(ContainerBase): # {{{
|
|||||||
def refresh_mime_map(self):
|
def refresh_mime_map(self):
|
||||||
for item in self.opf_xpath('//opf:manifest/opf:item[@href and @media-type]'):
|
for item in self.opf_xpath('//opf:manifest/opf:item[@href and @media-type]'):
|
||||||
href = item.get('href')
|
href = item.get('href')
|
||||||
name = self.href_to_name(href, self.opf_name)
|
try:
|
||||||
|
name = self.href_to_name(href, self.opf_name)
|
||||||
|
except ValueError:
|
||||||
|
continue # special filenames such as CON on windows cause relpath to fail
|
||||||
mt = item.get('media-type')
|
mt = item.get('media-type')
|
||||||
if name in self.mime_map and name != self.opf_name and mt:
|
if name in self.mime_map and name != self.opf_name and mt:
|
||||||
# some epubs include the opf in the manifest with an incorrect mime type
|
# some epubs include the opf in the manifest with an incorrect mime type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user