diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-06 09:33:13 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-06 09:33:13 -0400 |
commit | 705e6255fca83f5ff2b194e6529968017cefaaa3 (patch) | |
tree | 802f0e7c51f517581a969bfa0d686825e6028c67 /setuptools/py26compat.py | |
parent | 95bf90f3dae23f3d672450d94adfbcc55f9e252a (diff) | |
download | external_python_setuptools-705e6255fca83f5ff2b194e6529968017cefaaa3.tar.gz external_python_setuptools-705e6255fca83f5ff2b194e6529968017cefaaa3.tar.bz2 external_python_setuptools-705e6255fca83f5ff2b194e6529968017cefaaa3.zip |
Correct 404 errors when URLs contain fragments. Fixes #69.
Diffstat (limited to 'setuptools/py26compat.py')
-rw-r--r-- | setuptools/py26compat.py | 19 |
1 files changed, 19 insertions, 0 deletions
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 |