Commits

tarek  committed af557cf

fixed #20 - catching invalid URL error from httplib

  • Participants
  • Parent commits d6ac781
  • Branches 0.6-maintenance

Comments (0)

Files changed (3)

 * zip_ok is now True by default. This closes 
   http://bugs.python.org/setuptools/issue33.
 
+* Fixed invalid URL error catching. http://bugs.python.org/setuptools/issue20.
+
 bootstraping
 ============
 

File setuptools/package_index.py

             return local_open(url)
         try:
             return open_with_auth(url)
-        except ValueError, v:
+        except (ValueError, httplib.InvalidURL), v:
             msg = ' '.join([str(arg) for arg in v.args])
             if warning:
                 self.warn(warning, msg)

File setuptools/tests/test_packageindex.py

         finally:
             urllib2.urlopen = old_urlopen
 
+        # issue 20
+        url = 'http://http://svn.pythonpaste.org/Paste/wphp/trunk'
+        try:
+            index.open_url(url)
+        except Exception, v:
+            self.assert_('nonnumeric port' in str(v))
 
     def test_url_ok(self):
         index = setuptools.package_index.PackageIndex(