Commit b9d0a98d authored by Thomas Goirand's avatar Thomas Goirand

* Team upload.

  * Refresh hands-off-system-packages.patch.
  * Add Properly_catch_requests_HTTPError_in_index.py.patch: this fixes 404
    when using --extra-index-url due to the way we de-bundle python-requests
    from pip. Thanks to Fabio Natali <me@fabionatali.com> for the bug report,
    Clark Boylan for the patch, and all of the OpenStack infra team for their
    help and involving me for this fix (Closes: #837764).
parent 32522468
Pipeline #41536 passed with stages
in 7 minutes and 36 seconds
python-pip (18.1-5) unstable; urgency=medium
* Team upload.
* Refresh hands-off-system-packages.patch.
* Add Properly_catch_requests_HTTPError_in_index.py.patch: this fixes 404
when using --extra-index-url due to the way we de-bundle python-requests
from pip. Thanks to Fabio Natali <me@fabionatali.com> for the bug report,
Clark Boylan for the patch, and all of the OpenStack infra team for their
help and involving me for this fix (Closes: #837764).
-- Thomas Goirand <zigo@debian.org> Sat, 30 Mar 2019 21:10:13 +0100
python-pip (18.1-4) unstable; urgency=medium
* Generate Built-Using at the build time (Closes: #831271).
......
Description: Properly catch requests' HTTPError in index.py
This resolves issue #4195.
.
In index.py's index retrieval routine we were catching
requests.HTTPError to log and ignore 404s and other similar HTTP server
errors when pulling from (extra-)index-urls. Unfortunately, the actual
path to that exception is requests.exceptions.HTTPError and the alias we
were using does not work when pip is installed with unvendored libs as
with the debian packaged pip.
.
Thankfully the fix is simple. Import and use
requests.exceptions.HTTPError. This comes with the added bonus of
fitting in with the existing handling for RetryError and SSLError. With
this change in place upstream pip and downstream packaged pip should
both catch this exception properly.
.
Note: I've not added any tests cases as I'm unsure how to test the
distro packaging case within pip's testsuite. However, the existing test
suite should hopefully cover that this isn't a regression and I've
manually confirmed that this works with a hacked up debian package
install. Also this is how we handle RetryError and SSLError.
Author: Clark Boylan <clark.boylan@gmail.com>
Date: Fri, 29 Mar 2019 10:17:31 -0700
Origin: upstream, https://github.com/pypa/pip/pull/6367/commits/f8292a304deebcf0e4cda2e40caa226c70030f11
Bug-Debian: https://bugs.debian.org/837764
Last-Update: 2019-03-30
--- python-pip-18.1.orig/src/pip/_internal/index.py
+++ python-pip-18.1/src/pip/_internal/index.py
@@ -16,7 +16,7 @@ from pip._vendor.distlib.compat import u
from pip._vendor.packaging import specifiers
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.packaging.version import parse as parse_version
-from pip._vendor.requests.exceptions import SSLError
+from pip._vendor.requests.exceptions import HTTPError, SSLError
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
@@ -161,7 +161,7 @@ def _get_html_page(link, session=None):
return
inst = HTMLPage(resp.content, resp.url, resp.headers)
- except requests.HTTPError as exc:
+ except HTTPError as exc:
_handle_get_page_fail(link, exc, url)
except SSLError as exc:
reason = "There was a problem confirming the ssl certificate: "
......@@ -17,17 +17,18 @@ Last-Update: 2014-12-04
Patch-Name: hands-off-system-packages.patch
---
--- a/src/pip/_internal/utils/misc.py
+++ b/src/pip/_internal/utils/misc.py
@@ -285,22 +285,40 @@
Index: python-pip/src/pip/_internal/utils/misc.py
===================================================================
--- python-pip.orig/src/pip/_internal/utils/misc.py
+++ python-pip/src/pip/_internal/utils/misc.py
@@ -289,22 +289,40 @@ def renames(old, new):
def is_local(path):
"""
- Return True if path is within sys.prefix, if we're running in a virtualenv.
-
- If we're not in a virtualenv, all paths are considered "local."
+ Return True if this is a path pip is allowed to modify.
+
- If we're not in a virtualenv, all paths are considered "local."
+ If we're in a virtualenv, sys.prefix points to the virtualenv's
+ prefix; only sys.prefix is considered local.
+
......
......@@ -3,3 +3,4 @@ debundle.patch
handle-unbundled-requests.patch
set_user_default.patch
disable-pip-version-check.patch
Properly_catch_requests_HTTPError_in_index.py.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment