aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt1
-rwxr-xr-xsetuptools/package_index.py5
-rw-r--r--setuptools/tests/test_packageindex.py12
-rw-r--r--test.sh2
4 files changed, 18 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index ad743ae7..89760759 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ CHANGES
0.6.13
------
+* Issue 160: 2.7 gives ValueError("Invalid IPv6 URL")
*
------
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 924c15e1..1c50d86f 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -268,7 +268,10 @@ class PackageIndex(Environment):
# process an index page into the package-page index
for match in HREF.finditer(page):
- scan( urlparse.urljoin(url, htmldecode(match.group(1))) )
+ try:
+ scan( urlparse.urljoin(url, htmldecode(match.group(1))) )
+ except ValueError:
+ pass
pkg, ver = scan(url) # ensure this page is in the page index
if pkg:
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 29359a9c..8ae7a5b9 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -1,7 +1,7 @@
"""Package Index Tests
"""
# More would be better!
-
+import sys
import os, shutil, tempfile, unittest, urllib2
import pkg_resources
import setuptools.package_index
@@ -57,6 +57,16 @@ class TestPackageIndex(unittest.TestCase):
except Exception, v:
self.assert_('nonnumeric port' in str(v))
+
+ # issue #160
+ if sys.version_info[0] == 2 and sys.version_info[1] == 7:
+ # this should not fail
+ url = 'http://example.com'
+ page = ('<a href="http://www.famfamfam.com]('
+ 'http://www.famfamfam.com/">')
+ index.process_index(url, page)
+
+
def test_url_ok(self):
index = setuptools.package_index.PackageIndex(
hosts=('www.example.com',)
diff --git a/test.sh b/test.sh
index cc637f68..61599adb 100644
--- a/test.sh
+++ b/test.sh
@@ -2,6 +2,8 @@ python2.3 setup.py -q test
python2.4 setup.py -q test
python2.5 setup.py -q test
python2.6 setup.py -q test
+python2.7 setup.py -q test
+
rm -rf build
python3.1 setup.py -q test