1. Tarek Ziadé
  2. distribute

Commits

tarek  committed b4910e9

backported #324

  • Participants
  • Parent commits a98277f
  • Branches default

Comments (0)

Files changed (3)

File Distribute/CHANGES.txt

View file
  • Ignore whitespace
 
 * package_index.urlopen now catches BadStatusLine and malformed url errors.
 * zip_ok is now False by default
+* Fixed invalid URL error catching. 
 
 ---
 0.6

File Distribute/setuptools/package_index.py

View file
  • Ignore whitespace
             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 Distribute/setuptools/tests/test_packageindex.py

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