mirror of https://github.com/pypa/pip
Upgrade requests to 2.24.0
This commit is contained in:
parent
413968dd17
commit
28aad200b3
|
@ -0,0 +1 @@
|
|||
Upgrade requests to 2.24.0
|
|
@ -90,18 +90,29 @@ except (AssertionError, ValueError):
|
|||
"version!".format(urllib3.__version__, chardet.__version__),
|
||||
RequestsDependencyWarning)
|
||||
|
||||
# Attempt to enable urllib3's SNI support, if possible
|
||||
from pip._internal.utils.compat import WINDOWS
|
||||
if not WINDOWS:
|
||||
# Attempt to enable urllib3's fallback for SNI support
|
||||
# if the standard library doesn't support SNI or the
|
||||
# 'ssl' library isn't available.
|
||||
try:
|
||||
# Note: This logic prevents upgrading cryptography on Windows, if imported
|
||||
# as part of pip.
|
||||
from pip._internal.utils.compat import WINDOWS
|
||||
if not WINDOWS:
|
||||
raise ImportError("pip internals: don't import cryptography on Windows")
|
||||
try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
ssl = None
|
||||
|
||||
if not getattr(ssl, "HAS_SNI", False):
|
||||
from pip._vendor.urllib3.contrib import pyopenssl
|
||||
pyopenssl.inject_into_urllib3()
|
||||
|
||||
# Check cryptography version
|
||||
from cryptography import __version__ as cryptography_version
|
||||
_check_cryptography(cryptography_version)
|
||||
except ImportError:
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# urllib3's DependencyWarnings should be silenced.
|
||||
from pip._vendor.urllib3.exceptions import DependencyWarning
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
__title__ = 'requests'
|
||||
__description__ = 'Python HTTP for Humans.'
|
||||
__url__ = 'https://requests.readthedocs.io'
|
||||
__version__ = '2.23.0'
|
||||
__build__ = 0x022300
|
||||
__version__ = '2.24.0'
|
||||
__build__ = 0x022400
|
||||
__author__ = 'Kenneth Reitz'
|
||||
__author_email__ = 'me@kennethreitz.org'
|
||||
__license__ = 'Apache 2.0'
|
||||
|
|
|
@ -94,11 +94,11 @@ class ChunkedEncodingError(RequestException):
|
|||
|
||||
|
||||
class ContentDecodingError(RequestException, BaseHTTPError):
|
||||
"""Failed to decode response content"""
|
||||
"""Failed to decode response content."""
|
||||
|
||||
|
||||
class StreamConsumedError(RequestException, TypeError):
|
||||
"""The content for this response was already consumed"""
|
||||
"""The content for this response was already consumed."""
|
||||
|
||||
|
||||
class RetryError(RequestException):
|
||||
|
@ -106,21 +106,18 @@ class RetryError(RequestException):
|
|||
|
||||
|
||||
class UnrewindableBodyError(RequestException):
|
||||
"""Requests encountered an error when trying to rewind a body"""
|
||||
"""Requests encountered an error when trying to rewind a body."""
|
||||
|
||||
# Warnings
|
||||
|
||||
|
||||
class RequestsWarning(Warning):
|
||||
"""Base warning for Requests."""
|
||||
pass
|
||||
|
||||
|
||||
class FileModeWarning(RequestsWarning, DeprecationWarning):
|
||||
"""A file was opened in text mode, but Requests determined its binary length."""
|
||||
pass
|
||||
|
||||
|
||||
class RequestsDependencyWarning(RequestsWarning):
|
||||
"""An imported dependency doesn't match the expected version range."""
|
||||
pass
|
||||
|
|
|
@ -473,12 +473,12 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
|||
not isinstance(data, (basestring, list, tuple, Mapping))
|
||||
])
|
||||
|
||||
try:
|
||||
length = super_len(data)
|
||||
except (TypeError, AttributeError, UnsupportedOperation):
|
||||
length = None
|
||||
|
||||
if is_stream:
|
||||
try:
|
||||
length = super_len(data)
|
||||
except (TypeError, AttributeError, UnsupportedOperation):
|
||||
length = None
|
||||
|
||||
body = data
|
||||
|
||||
if getattr(body, 'tell', None) is not None:
|
||||
|
@ -916,7 +916,7 @@ class Response(object):
|
|||
return l
|
||||
|
||||
def raise_for_status(self):
|
||||
"""Raises stored :class:`HTTPError`, if one occurred."""
|
||||
"""Raises :class:`HTTPError`, if one occurred."""
|
||||
|
||||
http_error_msg = ''
|
||||
if isinstance(self.reason, bytes):
|
||||
|
|
|
@ -658,11 +658,13 @@ class Session(SessionRedirectMixin):
|
|||
|
||||
extract_cookies_to_jar(self.cookies, request, r.raw)
|
||||
|
||||
# Redirect resolving generator.
|
||||
gen = self.resolve_redirects(r, request, **kwargs)
|
||||
|
||||
# Resolve redirects if allowed.
|
||||
history = [resp for resp in gen] if allow_redirects else []
|
||||
if allow_redirects:
|
||||
# Redirect resolving generator.
|
||||
gen = self.resolve_redirects(r, request, **kwargs)
|
||||
history = [resp for resp in gen]
|
||||
else:
|
||||
history = []
|
||||
|
||||
# Shuffle things around if there's history.
|
||||
if history:
|
||||
|
|
|
@ -11,7 +11,7 @@ packaging==20.4
|
|||
pep517==0.8.2
|
||||
progress==1.5
|
||||
pyparsing==2.4.7
|
||||
requests==2.23.0
|
||||
requests==2.24.0
|
||||
certifi==2020.04.05.1
|
||||
chardet==3.0.4
|
||||
idna==2.9
|
||||
|
|
|
@ -21,35 +21,22 @@ index 6336a07d..9582fa73 100644
|
|||
# Kinda cool, though, right?
|
||||
|
||||
diff --git a/src/pip/_vendor/requests/__init__.py b/src/pip/_vendor/requests/__init__.py
|
||||
index 9c3b769..36a4ef40 100644
|
||||
index dc83261a8..517458b5a 100644
|
||||
--- a/src/pip/_vendor/requests/__init__.py
|
||||
+++ b/src/pip/_vendor/requests/__init__.py
|
||||
@@ -80,13 +80,15 @@ except (AssertionError, ValueError):
|
||||
RequestsDependencyWarning)
|
||||
@@ -94,6 +94,11 @@ except (AssertionError, ValueError):
|
||||
# if the standard library doesn't support SNI or the
|
||||
# 'ssl' library isn't available.
|
||||
try:
|
||||
+ # Note: This logic prevents upgrading cryptography on Windows, if imported
|
||||
+ # as part of pip.
|
||||
+ from pip._internal.utils.compat import WINDOWS
|
||||
+ if not WINDOWS:
|
||||
+ raise ImportError("pip internals: don't import cryptography on Windows")
|
||||
try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
|
||||
# Attempt to enable urllib3's SNI support, if possible
|
||||
-try:
|
||||
- from pip._vendor.urllib3.contrib import pyopenssl
|
||||
- pyopenssl.inject_into_urllib3()
|
||||
-
|
||||
- # Check cryptography version
|
||||
- from cryptography import __version__ as cryptography_version
|
||||
- _check_cryptography(cryptography_version)
|
||||
-except ImportError:
|
||||
- pass
|
||||
+from pip._internal.utils.compat import WINDOWS
|
||||
+if not WINDOWS:
|
||||
+ try:
|
||||
+ from pip._vendor.urllib3.contrib import pyopenssl
|
||||
+ pyopenssl.inject_into_urllib3()
|
||||
+
|
||||
+ # Check cryptography version
|
||||
+ from cryptography import __version__ as cryptography_version
|
||||
+ _check_cryptography(cryptography_version)
|
||||
+ except ImportError:
|
||||
+ pass
|
||||
|
||||
# urllib3's DependencyWarnings should be silenced.
|
||||
diff --git a/src/pip/_vendor/requests/compat.py b/src/pip/_vendor/requests/compat.py
|
||||
index eb6530d..353ec29 100644
|
||||
--- a/src/pip/_vendor/requests/compat.py
|
||||
|
|
Loading…
Reference in New Issue