Commit ae8f6226 authored by tarek's avatar tarek

fixed #20 - catching invalid URL error from httplib

--HG--
branch : distribute
extra : rebase_source : 6c6a92f65f6ac2d6d071ce525d0ef3e41167d59e
parent dd606e83
......@@ -16,6 +16,8 @@ setuptools
* 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
============
......
......@@ -578,7 +578,7 @@ class PackageIndex(Environment):
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)
......
......@@ -50,6 +50,12 @@ class TestPackageIndex(unittest.TestCase):
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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment