[Python-checkins] r57370 - sandbox/trunk/setuptools/setuptools/__init__.py sandbox/trunk/setuptools/setuptools/package_index.py

phillip.eby python-checkins at python.org
Fri Aug 24 05:14:32 CEST 2007


Author: phillip.eby
Date: Fri Aug 24 05:14:32 2007
New Revision: 57370

Modified:
   sandbox/trunk/setuptools/setuptools/__init__.py
   sandbox/trunk/setuptools/setuptools/package_index.py
Log:
Fix downloading from ftp: URLs (which don't have a content-type).


Modified: sandbox/trunk/setuptools/setuptools/__init__.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/__init__.py	(original)
+++ sandbox/trunk/setuptools/setuptools/__init__.py	Fri Aug 24 05:14:32 2007
@@ -80,5 +80,3 @@
 distutils.filelist.findall = findall    # fix findall bug in distutils.
 
 
-
-

Modified: sandbox/trunk/setuptools/setuptools/package_index.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/package_index.py	(original)
+++ sandbox/trunk/setuptools/setuptools/package_index.py	Fri Aug 24 05:14:32 2007
@@ -619,7 +619,7 @@
 
     def _attempt_download(self, url, filename):
         headers = self._download_to(url, filename)
-        if 'html' in headers['content-type'].lower():
+        if 'html' in headers.get('content-type','').lower():
             return self._download_html(url, headers, filename)
         else:
             return filename
@@ -695,7 +695,6 @@
 
 
 
-
 def open_with_auth(url):
     """Open a urllib2 request, handling HTTP authentication"""
 


More information about the Python-checkins mailing list