1. Adam Groszer
  2. distribute-0.6

Commits

Lennart Regebro  committed e015bfc

Only do the decoding if there is something to decode.

  • Participants
  • Parent commits 889fb94
  • 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()
-        if sys.version_info >= (3,):
+        if sys.version_info >= (3,) and not isinstance(f, urllib2.HTTPError):
             charset = f.headers.get_param('charset') or 'latin-1'
             page = page.decode(charset, "ignore")
         f.close()