From 8961b8b7b77fe68fbde2176c1d0e56cc11c14775 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 29 Jul 2008 19:26:26 +0200 Subject: [PATCH] url must be bytes --- oxlib/cache.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oxlib/cache.py b/oxlib/cache.py index a7095c0..b9b8b40 100644 --- a/oxlib/cache.py +++ b/oxlib/cache.py @@ -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: