url must be bytes
This commit is contained in:
parent
a9fb189924
commit
8961b8b7b7
1 changed files with 2 additions and 0 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue