Commit 55413ad5 authored by Martin v. Löwis's avatar Martin v. Löwis

Only decode HTML pages in 3.x.

--HG--
branch : distribute
extra : rebase_source : 58a286fe297947272398fc9ddd8f50594f54d4ae
parent cfa83c08
......@@ -197,8 +197,9 @@ class PackageIndex(Environment):
base = f.url # handle redirects
page = f.read()
charset = f.headers.get_param('charset') or 'latin-1'
page = page.decode(charset, "ignore")
if sys.version_info >= (3,):
charset = f.headers.get_param('charset') or 'latin-1'
page = page.decode(charset, "ignore")
f.close()
if url.startswith(self.index_url) and getattr(f,'code',None)!=404:
page = self.process_index(url, page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment