News download: Handle URLs that have commas and non ascii characters correctly

This commit is contained in:
Kovid Goyal 2010-01-09 14:24:48 -07:00
parent 5b4b130468
commit e9254aa75a
2 changed files with 3 additions and 3 deletions

View File

@ -191,9 +191,9 @@ class RecursiveFetcher(object):
if isinstance(url, unicode): if isinstance(url, unicode):
url = url.encode('utf-8') url = url.encode('utf-8')
# Not sure is this is really needed as I think mechanize # 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 # 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)) purl = list(urlparse.urlparse(url))
for i in range(2, 6): for i in range(2, 6):
purl[i] = quote(purl[i]) purl[i] = quote(purl[i])