Fix #2255 (calibre does not handle images with comma in their name)

This commit is contained in:
Kovid Goyal 2009-04-09 12:47:26 -07:00
parent 74cf23ddc8
commit 596b52afac

View File

@ -179,8 +179,11 @@ class RecursiveFetcher(object, LoggingInterface):
delta = time.time() - self.last_fetch_at delta = time.time() - self.last_fetch_at
if delta < self.delay: if delta < self.delay:
time.sleep(delta) time.sleep(delta)
if re.search(r'\s+', url) is not None: if re.search(r'\s+|,', url) is not None:
url = quote(url) purl = list(urlparse.urlparse(url))
for i in range(2, 6):
purl[i] = quote(purl[i])
url = urlparse.urlunparse(purl)
with self.browser_lock: with self.browser_lock:
try: try:
with closing(self.browser.open(url)) as f: with closing(self.browser.open(url)) as f: