Skip to content

Commit 141523c

Browse files
committed
Upgrade urllib3 to 1.26.15
1 parent 2b9effb commit 141523c

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
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.15

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.14"
2+
__version__ = "1.26.15"

src/pip/_vendor/urllib3/connection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ def putheader(self, header, *values):
229229
)
230230

231231
def request(self, method, url, body=None, headers=None):
232+
# Update the inner socket's timeout value to send the request.
233+
# This only triggers if the connection is re-used.
234+
if getattr(self, "sock", None) is not None:
235+
self.sock.settimeout(self.timeout)
236+
232237
if headers is None:
233238
headers = {}
234239
else:

src/pip/_vendor/urllib3/connectionpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _make_request(
379379

380380
timeout_obj = self._get_timeout(timeout)
381381
timeout_obj.start_connect()
382-
conn.timeout = timeout_obj.connect_timeout
382+
conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout)
383383

384384
# Trigger any extra validation we need to do.
385385
try:

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import time
44

5-
# The default socket timeout, used by httplib to indicate that no timeout was
6-
# specified by the user
7-
from socket import _GLOBAL_DEFAULT_TIMEOUT
5+
# The default socket timeout, used by httplib to indicate that no timeout was; specified by the user
6+
from socket import _GLOBAL_DEFAULT_TIMEOUT, getdefaulttimeout
87

98
from ..exceptions import TimeoutStateError
109

@@ -116,6 +115,10 @@ def __repr__(self):
116115
# __str__ provided for backwards compatibility
117116
__str__ = __repr__
118117

118+
@classmethod
119+
def resolve_default_timeout(cls, timeout):
120+
return getdefaulttimeout() if timeout is cls.DEFAULT_TIMEOUT else timeout
121+
119122
@classmethod
120123
def _validate_timeout(cls, value, name):
121124
"""Check that a timeout attribute is valid.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"(?:(?:%(hex)s:){0,6}%(hex)s)?::",
5151
]
5252

53-
UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~"
53+
UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~"
5454
IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")"
5555
ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+"
5656
IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]"
@@ -303,7 +303,7 @@ def _normalize_host(host, scheme):
303303

304304

305305
def _idna_encode(name):
306-
if name and any([ord(x) > 128 for x in name]):
306+
if name and any(ord(x) >= 128 for x in name):
307307
try:
308308
from pip._vendor import idna
309309
except ImportError:

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.14
14+
urllib3==1.26.15
1515
rich==12.6.0
1616
pygments==2.13.0
1717
typing_extensions==4.4.0

0 commit comments

Comments
 (0)