diff options
Diffstat (limited to 'setuptools')
-rwxr-xr-x | setuptools/command/upload.py | 3 | ||||
-rw-r--r-- | setuptools/compat.py | 4 | ||||
-rwxr-xr-x | setuptools/package_index.py | 3 | ||||
-rw-r--r-- | setuptools/py26compat.py | 19 | ||||
-rw-r--r-- | setuptools/version.py | 2 |
5 files changed, 25 insertions, 6 deletions
diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 575e121e..a6eff385 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -119,7 +119,7 @@ class upload(Command): boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' - body = StringIO.StringIO() + body = StringIO() for key, value in data.items(): # handle multiple entries for the same name if not isinstance(value, list): @@ -158,7 +158,6 @@ class upload(Command): raise AssertionError("unsupported schema " + schema) data = '' - loglevel = log.INFO try: http.connect() http.putrequest("POST", url) diff --git a/setuptools/compat.py b/setuptools/compat.py index 3a961c0e..860c39f3 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -26,7 +26,7 @@ if sys.version_info[0] < 3: reduce = reduce unichr = unichr unicode = unicode - from urllib import url2pathname + from urllib import url2pathname, splittag import urllib2 from urllib2 import urlopen, HTTPError, URLError, unquote, splituser from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit @@ -74,7 +74,7 @@ else: from urllib.request import urlopen, url2pathname from urllib.parse import ( urlparse, urlunparse, unquote, splituser, urljoin, urlsplit, - urlunsplit, + urlunsplit, splittag, ) xrange = range filterfalse = itertools.filterfalse diff --git a/setuptools/package_index.py b/setuptools/package_index.py index d949063e..4c9e40a7 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -22,6 +22,7 @@ from setuptools.compat import filterfalse from fnmatch import translate from setuptools.py24compat import hashlib from setuptools.py24compat import wraps +from setuptools.py26compat import strip_fragment from setuptools.py27compat import get_all_headers EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$') @@ -660,7 +661,7 @@ class PackageIndex(Environment): fp, tfp, info = None, None, None try: checker = HashChecker.from_url(url) - fp = self.open_url(url) + fp = self.open_url(strip_fragment(url)) if isinstance(fp, HTTPError): raise DistutilsError( "Can't download %s: %s %s" % (url, fp.code,fp.msg) diff --git a/setuptools/py26compat.py b/setuptools/py26compat.py new file mode 100644 index 00000000..6fc00883 --- /dev/null +++ b/setuptools/py26compat.py @@ -0,0 +1,19 @@ +""" +Compatibility Support for Python 2.6 and earlier +""" + +import sys + +from setuptools.compat import splittag + +def strip_fragment(url): + """ + In `Python 8280 <http://bugs.python.org/issue8280>`_, Python 2.7 and + later was patched to disregard the fragment when making URL requests. + Do the same for Python 2.6 and earlier. + """ + url, fragment = splittag(url) + return url + +if sys.version_info < (2,7): + strip_fragment = lambda x: x diff --git a/setuptools/version.py b/setuptools/version.py index 64477cf2..bc50bee6 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.2' +__version__ = '1.1.4' |