aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarek <none@none>2009-08-28 11:01:48 +0200
committertarek <none@none>2009-08-28 11:01:48 +0200
commitae8f6226eacfce9c5519f562c750b9db7aa98bdf (patch)
tree412c7ca330dee39a883fc116a1e1ea9b2aba6b76
parentdd606e831affd2ace8bd5a276d3bcc1aa1433c11 (diff)
downloadexternal_python_setuptools-ae8f6226eacfce9c5519f562c750b9db7aa98bdf.tar.gz
external_python_setuptools-ae8f6226eacfce9c5519f562c750b9db7aa98bdf.tar.bz2
external_python_setuptools-ae8f6226eacfce9c5519f562c750b9db7aa98bdf.zip
fixed #20 - catching invalid URL error from httplib
--HG-- branch : distribute extra : rebase_source : 6c6a92f65f6ac2d6d071ce525d0ef3e41167d59e
-rw-r--r--CHANGES.txt2
-rwxr-xr-xsetuptools/package_index.py2
-rw-r--r--setuptools/tests/test_packageindex.py6
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 20361859..b4645e06 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -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
============
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index fef62942..220cdec7 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -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)
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index d7efe1bc..18a06de5 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -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(