replace space in url with %20

This commit is contained in:
j 2007-04-06 17:03:24 +00:00
parent 19c52e22a4
commit 13d333f841

View file

@ -56,6 +56,7 @@ def read_url(url, headers=DEFAULT_HEADERS, blocking=True):
False, returns an iterator which gives None until a successful read, False, returns an iterator which gives None until a successful read,
at which point the str page contents is yielded. at which point the str page contents is yielded.
""" """
url = url.replace(' ', '%20')
req = urllib2.Request(url, None, headers) req = urllib2.Request(url, None, headers)
f = urllib2.urlopen(req) f = urllib2.urlopen(req)
data = f.read() data = f.read()