From 39287d31feb89c97d091be3c597338be1fa879c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 17 Feb 2014 21:05:44 +0530 Subject: [PATCH] HTML Input: Fix incorrect parsing of file names in href/src attributes that contain percent encoded non-ascii characters. Fixes #1281099 [No images/pictures while html to epub conversion since update to 1.24 !!](https://bugs.launchpad.net/calibre/+bug/1281099) --- src/calibre/ebooks/html/input.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index df6793b107..ba943a2c3c 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -13,8 +13,8 @@ Input plugin for HTML or OPF ebooks. import os, re, sys, errno as gerrno from urlparse import urlparse, urlunparse -from urllib import unquote +from calibre.ebooks.oeb.base import urlunquote from calibre.ebooks.chardet import detect_xml_encoding from calibre.constants import iswindows from calibre import unicode_path, as_unicode, replace_entities @@ -33,7 +33,7 @@ class Link(object): path = path[1:] isabs = True path = urlunparse(('', '', path, url.params, url.query, '')) - path = unquote(path) + path = urlunquote(path) if isabs or os.path.isabs(path): return path return os.path.abspath(os.path.join(base, path)) @@ -50,7 +50,7 @@ class Link(object): self.is_local = self.parsed_url.scheme in ('', 'file') self.is_internal = self.is_local and not bool(self.parsed_url.path) self.path = None - self.fragment = unquote(self.parsed_url.fragment) + self.fragment = urlunquote(self.parsed_url.fragment) if self.is_local and not self.is_internal: self.path = self.url_to_local_path(self.parsed_url, base)