1. Tarek Ziadé
  2. distribute

Commits

Martin von Löwis  committed 93ddf1f

Only decode HTML pages in 3.x.

  • Participants
  • Parent commits 1fc7109
  • Branches 0.6-maintenance

Comments (0)

Files changed (1)

File setuptools/package_index.py

View file
  • Ignore whitespace
 
         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)