From 705e6255fca83f5ff2b194e6529968017cefaaa3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:33:13 -0400 Subject: Correct 404 errors when URLs contain fragments. Fixes #69. --- setuptools/py26compat.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 setuptools/py26compat.py (limited to 'setuptools/py26compat.py') 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 `_, 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 -- cgit v1.2.1