Skip to content

Commit

Permalink
Upgrade urllib3 to 1.26.17 (#12343)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore authored Oct 12, 2023
1 parent 496b268 commit 2333ef3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/urllib3.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade urllib3 to 1.26.17
2 changes: 1 addition & 1 deletion src/pip/_vendor/urllib3/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is protected via CODEOWNERS
__version__ = "1.26.16"
__version__ = "1.26.17"
21 changes: 21 additions & 0 deletions src/pip/_vendor/urllib3/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from __future__ import absolute_import

import sys

from .filepost import encode_multipart_formdata
from .packages import six
from .packages.six.moves.urllib.parse import urlencode

__all__ = ["RequestMethods"]
Expand Down Expand Up @@ -168,3 +171,21 @@ def request_encode_body(
extra_kw.update(urlopen_kw)

return self.urlopen(method, url, **extra_kw)


if not six.PY2:

class RequestModule(sys.modules[__name__].__class__):
def __call__(self, *args, **kwargs):
"""
If user tries to call this module directly urllib3 v2.x style raise an error to the user
suggesting they may need urllib3 v2
"""
raise TypeError(
"'module' object is not callable\n"
"urllib3.request() method is not supported in this release, "
"upgrade to urllib3 v2 to use it\n"
"see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html"
)

sys.modules[__name__].__class__ = RequestModule
2 changes: 1 addition & 1 deletion src/pip/_vendor/urllib3/util/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Retry(object):
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])

#: Default headers to be used for ``remove_headers_on_redirect``
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Authorization"])
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Cookie", "Authorization"])

#: Maximum backoff time.
DEFAULT_BACKOFF_MAX = 120
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requests==2.31.0
certifi==2023.7.22
chardet==5.1.0
idna==3.4
urllib3==1.26.16
urllib3==1.26.17
rich==13.4.2
pygments==2.15.1
typing_extensions==4.7.1
Expand Down

0 comments on commit 2333ef3

Please sign in to comment.