summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2018-03-21 22:35:40 -0400
committerGitHub <noreply@github.com>2018-03-21 22:35:40 -0400
commitb20235d7c9e6a7ece969567ad0a21b55aea96624 (patch)
treed8e506a709462b7cebc8e414cf04531a6e9c309f
parent2634beb27a68199b2b7783a6a22b6684c415d094 (diff)
parent4c16e71cdd4752831476a590355c30451b88f651 (diff)
downloadpip-b20235d7c9e6a7ece969567ad0a21b55aea96624.tar.gz
Merge pull request #5106 from dstufft/merged/9.0.3
Merged/9.0.3
-rw-r--r--NEWS.rst8
-rw-r--r--src/pip/_vendor/requests/packages.py8
-rw-r--r--tasks/vendoring/patches/requests.patch14
3 files changed, 24 insertions, 6 deletions
diff --git a/NEWS.rst b/NEWS.rst
index a3b05ed83..2ae1fc508 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -8,6 +8,14 @@
.. towncrier release notes start
+9.0.3 (2018-03-21)
+==================
+
+- Fix an error where the vendored requests was not correctly containing itself
+ to only the internal vendored prefix.
+- Restore compatability with 2.6.
+
+
9.0.2 (2018-03-16)
==================
diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
index 6336a07d9..9582fa730 100644
--- a/src/pip/_vendor/requests/packages.py
+++ b/src/pip/_vendor/requests/packages.py
@@ -4,11 +4,13 @@ import sys
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
- locals()[package] = __import__("pip._vendor." + package)
+ vendored_package = "pip._vendor." + package
+ locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for mod in list(sys.modules):
- if mod == package or mod.startswith(package + '.'):
- sys.modules['requests.packages.' + mod] = sys.modules[mod]
+ if mod == vendored_package or mod.startswith(vendored_package + '.'):
+ unprefixed_mod = mod[len("pip._vendor."):]
+ sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
# Kinda cool, though, right?
diff --git a/tasks/vendoring/patches/requests.patch b/tasks/vendoring/patches/requests.patch
index b4aa10a37..e09171c50 100644
--- a/tasks/vendoring/patches/requests.patch
+++ b/tasks/vendoring/patches/requests.patch
@@ -1,16 +1,24 @@
diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
-index 7232fe0f..6336a07d 100644
+index 6336a07d..9582fa73 100644
--- a/src/pip/_vendor/requests/packages.py
+++ b/src/pip/_vendor/requests/packages.py
-@@ -4,7 +4,7 @@ import sys
+@@ -4,11 +4,13 @@ import sys
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
- locals()[package] = __import__(package)
-+ locals()[package] = __import__("pip._vendor." + package)
++ vendored_package = "pip._vendor." + package
++ locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for mod in list(sys.modules):
+- if mod == package or mod.startswith(package + '.'):
+- sys.modules['requests.packages.' + mod] = sys.modules[mod]
++ if mod == vendored_package or mod.startswith(vendored_package + '.'):
++ unprefixed_mod = mod[len("pip._vendor."):]
++ sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
+
+ # Kinda cool, though, right?
diff --git a/src/pip/_vendor/requests/__init__.py b/src/pip/_vendor/requests/__init__.py
index 9c3b769..44f6836 100644