url must be bytes

This commit is contained in:
j 2008-07-29 19:26:26 +02:00
parent a9fb189924
commit 8961b8b7b7

View file

@ -51,6 +51,8 @@ def getHeaders(url, data=None, headers=DEFAULT_HEADERS, timeout=cache_timeout):
return url_headers return url_headers
def getUrl(url, data=None, headers=DEFAULT_HEADERS, timeout=cache_timeout): 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) url_cache_file = _getUrlCacheFile(url, data, headers)
result = _loadUrlCache(url_cache_file, timeout) result = _loadUrlCache(url_cache_file, timeout)
if not result: if not result: