mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #889323 (odd codes in image address crash the input process)
This commit is contained in:
parent
59cecac007
commit
19b54b8008
@ -13,7 +13,7 @@ Input plugin for HTML or OPF ebooks.
|
||||
|
||||
import os, re, sys, uuid, tempfile, errno as gerrno
|
||||
from urlparse import urlparse, urlunparse
|
||||
from urllib import unquote
|
||||
from urllib import unquote, quote
|
||||
from functools import partial
|
||||
from itertools import izip
|
||||
|
||||
@ -468,7 +468,10 @@ class HTMLInput(InputFormatPlugin):
|
||||
self.oeb.log, ignore_opf=True)
|
||||
# Load into memory
|
||||
item = self.oeb.manifest.add(id, href, media_type)
|
||||
item.html_input_href = bhref
|
||||
# bhref refers to an already existing file. The read() method of
|
||||
# DirContainer will call unquote on it before trying to read the
|
||||
# file, therefore we quote it here.
|
||||
item.html_input_href = quote(bhref)
|
||||
if guessed in self.OEB_STYLES:
|
||||
item.override_css_fetch = partial(
|
||||
self.css_import_handler, os.path.dirname(link))
|
||||
|
Loading…
x
Reference in New Issue
Block a user