url must be bytes

This commit is contained in:
j 2008-07-29 19:26:26 +02:00
parent a9fb189924
commit 8961b8b7b7
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,8 @@ def getHeaders(url, data=None, headers=DEFAULT_HEADERS, timeout=cache_timeout):
return url_headers
def getUrl(url, data=None, headers=DEFAULT_HEADERS, timeout=cache_timeout):
if isinstance(url, unicode):
url = url.encode('utf-8')
url_cache_file = _getUrlCacheFile(url, data, headers)
result = _loadUrlCache(url_cache_file, timeout)
if not result: