[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#926050: marked as done (stretch-pu: package python-pip/9.0.1-2+deb9u1)



Your message dated Sat, 27 Apr 2019 11:14:32 +0100
with message-id <1556360072.2690.35.camel@adam-barratt.org.uk>
and subject line Closing bugs for updates included in 9.9
has caused the Debian Bug report #926050,
regarding stretch-pu: package python-pip/9.0.1-2+deb9u1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
926050: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926050
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu

Dear release team,

I would like to upload a fix to python-pip to Stretch, fixing pip download
when using --extra-index-url. Pip is indeed broken because of the way pip
handles exceptions from the vendored requests module, and the way Debian
de-embbed requests. The patch is pretty short (2 lines are changed).

Debdiff is attached.

Please allow me to upload python-pip/9.0.1-2+deb9u1 to stretch PU.

Cheers,

Thomas Goirand (zigo)
diff -Nru python-pip-9.0.1/debian/changelog python-pip-9.0.1/debian/changelog
--- python-pip-9.0.1/debian/changelog	2017-01-11 21:48:53.000000000 +0100
+++ python-pip-9.0.1/debian/changelog	2019-03-31 00:02:11.000000000 +0100
@@ -1,3 +1,12 @@
+python-pip (9.0.1-2+deb9u1) stretch; urgency=medium
+
+  * Team upload.
+  * Add Properly_catch_requests_HTTPError_in_index.py.patch, which fixes
+    --extra-index-url results in "HTTPError: 404 Client Error: NOT FOUND".
+    The patch makes works even with the unbundled requests. (Closes: #837764).
+
+ -- Thomas Goirand <zigo@debian.org>  Sun, 31 Mar 2019 00:02:11 +0100
+
 python-pip (9.0.1-2) unstable; urgency=medium
 
   * d/control: Update python-setuptools Built-Using version.
diff -Nru python-pip-9.0.1/debian/patches/Properly_catch_requests_HTTPError_in_index.py.patch python-pip-9.0.1/debian/patches/Properly_catch_requests_HTTPError_in_index.py.patch
--- python-pip-9.0.1/debian/patches/Properly_catch_requests_HTTPError_in_index.py.patch	1970-01-01 01:00:00.000000000 +0100
+++ python-pip-9.0.1/debian/patches/Properly_catch_requests_HTTPError_in_index.py.patch	2019-03-31 00:01:10.000000000 +0100
@@ -0,0 +1,47 @@
+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-9.0.1.orig/pip/index.py
++++ python-pip-9.0.1/pip/index.py
+@@ -34,7 +34,7 @@ from pip._vendor import html5lib, reques
+ from pip._vendor.packaging.version import parse as parse_version
+ from pip._vendor.packaging.utils import canonicalize_name
+ from pip._vendor.packaging import specifiers
+-from pip._vendor.requests.exceptions import SSLError
++from pip._vendor.requests.exceptions import HTTPError, SSLError
+ from pip._vendor.distlib.compat import unescape
+ 
+ 
+@@ -809,7 +809,7 @@ class HTMLPage(object):
+                 return
+ 
+             inst = cls(resp.content, resp.url, resp.headers)
+-        except requests.HTTPError as exc:
++        except HTTPError as exc:
+             cls._handle_fail(link, exc, url)
+         except SSLError as exc:
+             reason = ("There was a problem confirming the ssl certificate: "
diff -Nru python-pip-9.0.1/debian/patches/series python-pip-9.0.1/debian/patches/series
--- python-pip-9.0.1/debian/patches/series	2017-01-11 21:48:53.000000000 +0100
+++ python-pip-9.0.1/debian/patches/series	2019-03-31 00:02:05.000000000 +0100
@@ -4,3 +4,4 @@
 set_user_default.patch
 disable-pip-version-check.patch
 html5lib-alternative-beta-name.patch
+Properly_catch_requests_HTTPError_in_index.py.patch

--- End Message ---
--- Begin Message ---
Version: 9.9

Hi,

The update referenced by each of these bugs was included in this
morning's stretch point release.

Regards,

Adam

--- End Message ---

Reply to: