Skip to content

Commit 17b7345

Browse files
committed
Upgrade urllib3 to 1.26.14
1 parent be20a75 commit 17b7345

File tree

10 files changed

+25
-12
lines changed

10 files changed

+25
-12
lines changed

news/urllib3.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade urllib3 to 1.26.14

src/pip/_vendor/urllib3/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file is protected via CODEOWNERS
2-
__version__ = "1.26.12"
2+
__version__ = "1.26.14"

src/pip/_vendor/urllib3/connectionpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def _is_ssl_error_message_from_http_proxy(ssl_error):
862862
)
863863

864864
# Check if we should retry the HTTP response.
865-
has_retry_after = bool(response.getheader("Retry-After"))
865+
has_retry_after = bool(response.headers.get("Retry-After"))
866866
if retries.is_retry(method, response.status, has_retry_after):
867867
try:
868868
retries = retries.increment(method, url, response=response, _pool=self)

src/pip/_vendor/urllib3/contrib/appengine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def urlopen(
224224
)
225225

226226
# Check if we should retry the HTTP response.
227-
has_retry_after = bool(http_response.getheader("Retry-After"))
227+
has_retry_after = bool(http_response.headers.get("Retry-After"))
228228
if retries.is_retry(method, http_response.status, has_retry_after):
229229
retries = retries.increment(method, url, response=http_response, _pool=self)
230230
log.debug("Retry: %s", url)

src/pip/_vendor/urllib3/contrib/ntlmpool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _new_conn(self):
6969
log.debug("Request headers: %s", headers)
7070
conn.request("GET", self.authurl, None, headers)
7171
res = conn.getresponse()
72-
reshdr = dict(res.getheaders())
72+
reshdr = dict(res.headers)
7373
log.debug("Response status: %s %s", res.status, res.reason)
7474
log.debug("Response headers: %s", reshdr)
7575
log.debug("Response data: %s [...]", res.read(100))
@@ -101,7 +101,7 @@ def _new_conn(self):
101101
conn.request("GET", self.authurl, None, headers)
102102
res = conn.getresponse()
103103
log.debug("Response status: %s %s", res.status, res.reason)
104-
log.debug("Response headers: %s", dict(res.getheaders()))
104+
log.debug("Response headers: %s", dict(res.headers))
105105
log.debug("Response data: %s [...]", res.read()[:100])
106106
if res.status != 200:
107107
if res.status == 401:

src/pip/_vendor/urllib3/contrib/pyopenssl.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
"""
4848
from __future__ import absolute_import
4949

50+
import OpenSSL.crypto
5051
import OpenSSL.SSL
5152
from cryptography import x509
5253
from cryptography.hazmat.backends.openssl import backend as openssl_backend
53-
from cryptography.hazmat.backends.openssl.x509 import _Certificate
5454

5555
try:
5656
from cryptography.x509 import UnsupportedExtension
@@ -228,9 +228,8 @@ def get_subj_alt_name(peer_cert):
228228
if hasattr(peer_cert, "to_cryptography"):
229229
cert = peer_cert.to_cryptography()
230230
else:
231-
# This is technically using private APIs, but should work across all
232-
# relevant versions before PyOpenSSL got a proper API for this.
233-
cert = _Certificate(openssl_backend, peer_cert._x509)
231+
der = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_ASN1, peer_cert)
232+
cert = x509.load_der_x509_certificate(der, openssl_backend)
234233

235234
# We want to find the SAN extension. Ask Cryptography to locate it (it's
236235
# faster than looping in Python)

src/pip/_vendor/urllib3/response.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io
44
import logging
55
import sys
6+
import warnings
67
import zlib
78
from contextlib import contextmanager
89
from socket import error as SocketError
@@ -657,9 +658,21 @@ def from_httplib(ResponseCls, r, **response_kw):
657658

658659
# Backwards-compatibility methods for http.client.HTTPResponse
659660
def getheaders(self):
661+
warnings.warn(
662+
"HTTPResponse.getheaders() is deprecated and will be removed "
663+
"in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.",
664+
category=DeprecationWarning,
665+
stacklevel=2,
666+
)
660667
return self.headers
661668

662669
def getheader(self, name, default=None):
670+
warnings.warn(
671+
"HTTPResponse.getheader() is deprecated and will be removed "
672+
"in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default).",
673+
category=DeprecationWarning,
674+
stacklevel=2,
675+
)
663676
return self.headers.get(name, default)
664677

665678
# Backwards compatibility for http.cookiejar

src/pip/_vendor/urllib3/util/retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def parse_retry_after(self, retry_after):
394394
def get_retry_after(self, response):
395395
"""Get the value of Retry-After in seconds."""
396396

397-
retry_after = response.getheader("Retry-After")
397+
retry_after = response.headers.get("Retry-After")
398398

399399
if retry_after is None:
400400
return None

src/pip/_vendor/urllib3/util/url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT[2:-2] + "$")
6464
ZONE_ID_RE = re.compile("(" + ZONE_ID_PAT + r")\]$")
6565

66-
_HOST_PORT_PAT = ("^(%s|%s|%s)(?::([0-9]{0,5}))?$") % (
66+
_HOST_PORT_PAT = ("^(%s|%s|%s)(?::0*?(|0|[1-9][0-9]{0,4}))?$") % (
6767
REG_NAME_PAT,
6868
IPV4_PAT,
6969
IPV6_ADDRZ_PAT,

src/pip/_vendor/vendor.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requests==2.28.2
1111
certifi==2022.12.7
1212
chardet==5.1.0
1313
idna==3.4
14-
urllib3==1.26.12
14+
urllib3==1.26.14
1515
rich==12.6.0
1616
pygments==2.13.0
1717
typing_extensions==4.4.0

0 commit comments

Comments
 (0)