decodeHTML works without connection object

master
pictuga 2013-09-25 11:08:58 +02:00
parent e759cd46c6
commit 3fd34ff1a6
1 changed files with 3 additions and 3 deletions

View File

@ -207,7 +207,7 @@ class HTMLDownloader(urllib2.HTTPCookieProcessor):
return self.parent.open(new, timeout=req.timeout) return self.parent.open(new, timeout=req.timeout)
# decode # decode
data = decodeHTML(resp, data) data = decodeHTML(data, resp)
fp = StringIO(data) fp = StringIO(data)
old_resp = resp old_resp = resp
@ -250,8 +250,8 @@ class CacheDownload(urllib2.BaseHandler):
https_request = http_request https_request = http_request
def decodeHTML(con, data): def decodeHTML(data, con=None):
if con.headers.getparam('charset'): if con is not None and con.headers.getparam('charset'):
log('header') log('header')
enc = con.headers.getparam('charset') enc = con.headers.getparam('charset')
else: else: