Bump urllib3 from 1.26.7 to 1.26.8 (#1607)

* Bump urllib3 from 1.26.7 to 1.26.8

Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.7 to 1.26.8.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/1.26.8/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.7...1.26.8)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update urllib3==1.26.8

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2022-01-25 11:07:41 -08:00 committed by GitHub
parent fe32b31d7a
commit c03edf6893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 65 additions and 46 deletions

View file

@ -1,2 +1,2 @@
# This file is protected via CODEOWNERS # This file is protected via CODEOWNERS
__version__ = "1.26.7" __version__ = "1.26.8"

View file

@ -51,7 +51,6 @@ from .exceptions import (
SubjectAltNameWarning, SubjectAltNameWarning,
SystemTimeWarning, SystemTimeWarning,
) )
from .packages.ssl_match_hostname import CertificateError, match_hostname
from .util import SKIP_HEADER, SKIPPABLE_HEADERS, connection from .util import SKIP_HEADER, SKIPPABLE_HEADERS, connection
from .util.ssl_ import ( from .util.ssl_ import (
assert_fingerprint, assert_fingerprint,
@ -61,6 +60,7 @@ from .util.ssl_ import (
resolve_ssl_version, resolve_ssl_version,
ssl_wrap_socket, ssl_wrap_socket,
) )
from .util.ssl_match_hostname import CertificateError, match_hostname
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -2,6 +2,7 @@ from __future__ import absolute_import
import errno import errno
import logging import logging
import re
import socket import socket
import sys import sys
import warnings import warnings
@ -35,7 +36,6 @@ from .exceptions import (
) )
from .packages import six from .packages import six
from .packages.six.moves import queue from .packages.six.moves import queue
from .packages.ssl_match_hostname import CertificateError
from .request import RequestMethods from .request import RequestMethods
from .response import HTTPResponse from .response import HTTPResponse
from .util.connection import is_connection_dropped from .util.connection import is_connection_dropped
@ -44,6 +44,7 @@ from .util.queue import LifoQueue
from .util.request import set_file_position from .util.request import set_file_position
from .util.response import assert_header_parsing from .util.response import assert_header_parsing
from .util.retry import Retry from .util.retry import Retry
from .util.ssl_match_hostname import CertificateError
from .util.timeout import Timeout from .util.timeout import Timeout
from .util.url import Url, _encode_target from .util.url import Url, _encode_target
from .util.url import _normalize_host as normalize_host from .util.url import _normalize_host as normalize_host
@ -301,8 +302,11 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
pass pass
except queue.Full: except queue.Full:
# This should never happen if self.block == True # This should never happen if self.block == True
log.warning("Connection pool is full, discarding connection: %s", self.host) log.warning(
"Connection pool is full, discarding connection: %s. Connection pool size: %s",
self.host,
self.pool.qsize(),
)
# Connection never got put back into the pool, close it. # Connection never got put back into the pool, close it.
if conn: if conn:
conn.close() conn.close()
@ -745,7 +749,33 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
# Discard the connection for these exceptions. It will be # Discard the connection for these exceptions. It will be
# replaced during the next _get_conn() call. # replaced during the next _get_conn() call.
clean_exit = False clean_exit = False
if isinstance(e, (BaseSSLError, CertificateError)):
def _is_ssl_error_message_from_http_proxy(ssl_error):
# We're trying to detect the message 'WRONG_VERSION_NUMBER' but
# SSLErrors are kinda all over the place when it comes to the message,
# so we try to cover our bases here!
message = " ".join(re.split("[^a-z]", str(ssl_error).lower()))
return (
"wrong version number" in message or "unknown protocol" in message
)
# Try to detect a common user error with proxies which is to
# set an HTTP proxy to be HTTPS when it should be 'http://'
# (ie {'http': 'http://proxy', 'https': 'https://proxy'})
# Instead we add a nice error message and point to a URL.
if (
isinstance(e, BaseSSLError)
and self.proxy
and _is_ssl_error_message_from_http_proxy(e)
):
e = ProxyError(
"Your proxy appears to only use HTTP and not HTTPS, "
"try changing your proxy URL to be HTTP. See: "
"https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html"
"#https-proxy-error-http-proxy",
SSLError(e),
)
elif isinstance(e, (BaseSSLError, CertificateError)):
e = SSLError(e) e = SSLError(e)
elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy: elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy:
e = ProxyError("Cannot connect to proxy.", e) e = ProxyError("Cannot connect to proxy.", e)

View file

@ -48,7 +48,7 @@ from ctypes import (
) )
from ctypes.util import find_library from ctypes.util import find_library
from urllib3.packages.six import raise_from from ...packages.six import raise_from
if platform.system() != "Darwin": if platform.system() != "Darwin":
raise ImportError("Only macOS is supported") raise ImportError("Only macOS is supported")

View file

@ -1,5 +0,0 @@
from __future__ import absolute_import
from . import ssl_match_hostname
__all__ = ("ssl_match_hostname",)

View file

@ -1,24 +0,0 @@
import sys
try:
# Our match_hostname function is the same as 3.10's, so we only want to
# import the match_hostname function if it's at least that good.
# We also fallback on Python 3.10+ because our code doesn't emit
# deprecation warnings and is the same as Python 3.10 otherwise.
if sys.version_info < (3, 5) or sys.version_info >= (3, 10):
raise ImportError("Fallback to vendored code")
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import ( # type: ignore
CertificateError,
match_hostname,
)
except ImportError:
# Our vendored copy
from ._implementation import CertificateError, match_hostname # type: ignore
# Not needed, but documenting what we provide.
__all__ = ("CertificateError", "match_hostname")

View file

@ -2,9 +2,8 @@ from __future__ import absolute_import
import socket import socket
from urllib3.exceptions import LocationParseError
from ..contrib import _appengine_environ from ..contrib import _appengine_environ
from ..exceptions import LocationParseError
from ..packages import six from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read from .wait import NoWayToWaitForSocketError, wait_for_read

View file

@ -69,6 +69,24 @@ class _RetryMeta(type):
) )
cls.DEFAULT_REMOVE_HEADERS_ON_REDIRECT = value cls.DEFAULT_REMOVE_HEADERS_ON_REDIRECT = value
@property
def BACKOFF_MAX(cls):
warnings.warn(
"Using 'Retry.BACKOFF_MAX' is deprecated and "
"will be removed in v2.0. Use 'Retry.DEFAULT_BACKOFF_MAX' instead",
DeprecationWarning,
)
return cls.DEFAULT_BACKOFF_MAX
@BACKOFF_MAX.setter
def BACKOFF_MAX(cls, value):
warnings.warn(
"Using 'Retry.BACKOFF_MAX' is deprecated and "
"will be removed in v2.0. Use 'Retry.DEFAULT_BACKOFF_MAX' instead",
DeprecationWarning,
)
cls.DEFAULT_BACKOFF_MAX = value
@six.add_metaclass(_RetryMeta) @six.add_metaclass(_RetryMeta)
class Retry(object): class Retry(object):
@ -181,7 +199,7 @@ class Retry(object):
seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep
for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer
than :attr:`Retry.BACKOFF_MAX`. than :attr:`Retry.DEFAULT_BACKOFF_MAX`.
By default, backoff is disabled (set to 0). By default, backoff is disabled (set to 0).
@ -220,7 +238,7 @@ class Retry(object):
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Authorization"]) DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Authorization"])
#: Maximum backoff time. #: Maximum backoff time.
BACKOFF_MAX = 120 DEFAULT_BACKOFF_MAX = 120
def __init__( def __init__(
self, self,
@ -348,7 +366,7 @@ class Retry(object):
return 0 return 0
backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1)) backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1))
return min(self.BACKOFF_MAX, backoff_value) return min(self.DEFAULT_BACKOFF_MAX, backoff_value)
def parse_retry_after(self, retry_after): def parse_retry_after(self, retry_after):
# Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4 # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4

View file

@ -9,7 +9,7 @@ import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the # ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, use it to handle IPAddress ServerAltnames (this was added in # system, use it to handle IPAddress ServerAltnames (this was added in
# python-3.5) otherwise only do DNS matching. This allows # python-3.5) otherwise only do DNS matching. This allows
# backports.ssl_match_hostname to continue to be used in Python 2.7. # util.ssl_match_hostname to continue to be used in Python 2.7.
try: try:
import ipaddress import ipaddress
except ImportError: except ImportError:
@ -78,7 +78,8 @@ def _dnsname_match(dn, hostname, max_wildcards=1):
def _to_unicode(obj): def _to_unicode(obj):
if isinstance(obj, str) and sys.version_info < (3,): if isinstance(obj, str) and sys.version_info < (3,):
obj = unicode(obj, encoding="ascii", errors="strict") # ignored flake8 # F821 to support python 2.7 function
obj = unicode(obj, encoding="ascii", errors="strict") # noqa: F821
return obj return obj

View file

@ -2,8 +2,8 @@ import io
import socket import socket
import ssl import ssl
from urllib3.exceptions import ProxySchemeUnsupported from ..exceptions import ProxySchemeUnsupported
from urllib3.packages import six from ..packages import six
SSL_BLOCKSIZE = 16384 SSL_BLOCKSIZE = 16384

View file

@ -45,7 +45,7 @@ tempora==4.1.2
tokenize-rt==4.2.1 tokenize-rt==4.2.1
tzdata==2021.5 tzdata==2021.5
tzlocal==2.1 # apscheduler==3.8.0 requires tzlocal~=2.0 tzlocal==2.1 # apscheduler==3.8.0 requires tzlocal~=2.0
urllib3==1.26.7 urllib3==1.26.8
webencodings==0.5.1 webencodings==0.5.1
websocket-client==1.2.3 websocket-client==1.2.3
xmltodict==0.12.0 xmltodict==0.12.0