From e9254aa75a97f43035ebc321ae9e5a3a6d0477a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Jan 2010 14:24:48 -0700 Subject: [PATCH] News download: Handle URLs that have commas and non ascii characters correctly --- src/calibre/ebooks/txt/input.py | 2 +- src/calibre/web/fetch/simple.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/txt/input.py b/src/calibre/ebooks/txt/input.py index 9b1d80be3f..7be1a3449a 100644 --- a/src/calibre/ebooks/txt/input.py +++ b/src/calibre/ebooks/txt/input.py @@ -55,7 +55,7 @@ class TXTInput(InputFormatPlugin): html = convert_markdown(txt, disable_toc=options.markdown_disable_toc) except RuntimeError: raise ValueError('This txt file has malformed markup, it cannot be' - 'converted by calibre. See http://daringfireball.net/projects/markdown/syntax') + ' converted by calibre. See http://daringfireball.net/projects/markdown/syntax') else: html = convert_basic(txt) diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index ecb0315bb2..7101facbf9 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -191,9 +191,9 @@ class RecursiveFetcher(object): if isinstance(url, unicode): url = url.encode('utf-8') # Not sure is this is really needed as I think mechanize - # handles quoting automatically, but leaving it in + # handles quoting automatically, but leaving it # in case it breaks something - if re.search(r'\s+|,', url) is not None: + if re.search(r'\s+', url) is not None: purl = list(urlparse.urlparse(url)) for i in range(2, 6): purl[i] = quote(purl[i])