Skip to content
Myr

Merge branch 'psf:main' into patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by anupam-arista · committed by GitHub · parents 1286261, 0e322af · Browse files · 64 files+1288 added−113 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

64 files+1288 added−113 removed

  • tests:+789 added−3 removed
  • other:+499 added−110 removed

64 files+1288 added−113 removed

modified:.github/ISSUE_TEMPLATE/Custom.md+3 added
modified:.github/ISSUE_TEMPLATE/Feature_request.md+3 added
added:.github/workflows/close-issues.yml+35 added
modified:.github/workflows/codeql-analysis.yml+4 added-4 removed
modified:.github/workflows/lint.yml+2 added-2 removed
modified:.github/workflows/lock-issues.yml+1 added-1 removed
modified:.github/workflows/run-tests.yml+31 added-7 removed
modified:docs/_templates/sidebarintro.html+6 added-6 removed
14 unmodified lines
15</p>1617<h3>Useful Links</h3>18<ul>19 <li><a href="https://requests.readthedocs.io/en/latest/user/quickstart/">Quickstart</a></li>20 <li><a href="https://requests.readthedocs.io/en/latest/user/advanced/">Advanced Usage</a></li>21 <li><a href="https://requests.readthedocs.io/en/latest/api/">API Reference</a></li>22 <li><a href="https://requests.readthedocs.io/en/latest/community/updates/#release-history">Release History</a></li>23 <li><a href="https://requests.readthedocs.io/en/latest/dev/contributing/">Contributors Guide</a></li>19 <li><a href="{{ pathto('user/quickstart') }}">Quickstart</a></li>20 <li><a href="{{ pathto('user/advanced') }}">Advanced Usage</a></li>21 <li><a href="{{ pathto('api') }}">API Reference</a></li>22 <li><a href="{{ pathto('community/updates') + '#release-history' }}">Release History</a></li>23 <li><a href="{{ pathto('dev/contributing') }}">Contributors Guide</a></li>2425 <p></p>2627 <li><a href="https://requests.readthedocs.io/en/latest/community/recommended/">Recommended Packages and Extensions</a></li>27 <li><a href="{{ pathto('community/recommended') }}">Recommended Packages and Extensions</a></li>2829 <p></p>3031 <li><a href="https://github.com/psf/requests">Requests @ GitHub</a></li>
6 unmodified lines
modified:docs/_templates/sidebarlogo.html+6 added-6 removed
9 unmodified lines
10</p>1112<h3>Useful Links</h3>13<ul>14 <li><a href="https://requests.readthedocs.io/en/latest/user/quickstart/">Quickstart</a></li>15 <li><a href="https://requests.readthedocs.io/en/latest/user/advanced/">Advanced Usage</a></li>16 <li><a href="https://requests.readthedocs.io/en/latest/api/">API Reference</a></li>17 <li><a href="https://requests.readthedocs.io/en/latest/community/updates/#release-history">Release History</a></li>18 <li><a href="https://requests.readthedocs.io/en/latest/dev/contributing/">Contributors Guide</a></li>14 <li><a href="{{ pathto('user/quickstart') }}">Quickstart</a></li>15 <li><a href="{{ pathto('user/advanced') }}">Advanced Usage</a></li>16 <li><a href="{{ pathto('api') }}">API Reference</a></li>17 <li><a href="{{ pathto('community/updates') + '#release-history' }}">Release History</a></li>18 <li><a href="{{ pathto('dev/contributing') }}">Contributors Guide</a></li>1920 <p></p>2122 <li><a href="https://requests.readthedocs.io/en/latest/community/recommended/">Recommended Packages and Extensions</a></li>22 <li><a href="{{ pathto('community/recommended') }}">Recommended Packages and Extensions</a></li>2324 <p></p>2526 <li><a href="https://github.com/psf/requests">Requests @ GitHub</a></li>
4 unmodified lines
modified:docs/community/faq.rst+2 added-2 removed
20 unmodified lines
21Custom User-Agents?22-------------------2324Requests allows you to easily override User-Agent strings, along with25any other HTTP Header. See `documentation about headers <https://requests.readthedocs.io/en/latest/user/quickstart/#custom-headers>`_.25any other HTTP Header. See :ref:`documentation about headers <custom-headers>`.26272829Why not Httplib2?
24 unmodified lines
5455Python 3 Support?56-----------------5758Yes! Requests officially supports Python 3.7+ and PyPy.58Yes! Requests officially supports Python 3.8+ and PyPy.5960Python 2 Support?61-----------------62
27 unmodified lines
modified:docs/community/out-there.rst+1 added-13 removed
1Integrations2============34Python for iOS5--------------67Requests is built into the wonderful `Python for iOS <https://itunes.apple.com/us/app/python-2.7-for-ios/id485729872?mt=Python8>`_ runtime!89To give it a try, simply::1011 import requests12134Articles & Talks5================16- `Python for the Web <https://www.gun.io/blog/python-for-the-web>`_ teaches how to use Python to interact with the web, using Requests.6- `Daniel Greenfeld's Review of Requests <https://pydanny.blogspot.com/2011/05/python-http-requests-for-humans.html>`_18- `My 'Python for Humans' talk <http://python-for-humans.heroku.com>`_ ( `audio <https://codeconf.s3.amazonaws.com/2011/pycodeconf/talks/PyCodeConf2011%20-%20Kenneth%20Reitz.m4a>`_ )19- `Issac Kelly's 'Consuming Web APIs' talk <https://issackelly.github.com/Consuming-Web-APIs-with-Python-Talk/slides/slides.html>`_7- `Issac Kelly's 'Consuming Web APIs' talk <https://issackelly.github.io/Consuming-Web-APIs-with-Python-Talk/slides/slides.html>`_8- `Blog post about Requests via Yum <https://arunsag.wordpress.com/2011/08/17/new-package-python-requests-http-for-humans/>`_9- `Russian blog post introducing Requests <https://habr.com/post/126262/>`_10- `Sending JSON in Requests <http://www.coglib.com/~icordasc/blog/2014/11/sending-json-in-requests.html>`_
modified:docs/user/advanced.rst+19 added-3 removed
289 unmodified lines
290291For the sake of security we recommend upgrading certifi frequently!292293.. _HTTP persistent connection: https://en.wikipedia.org/wiki/HTTP_persistent_connection294.. _connection pooling: https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool294.. _connection pooling: https://urllib3.readthedocs.io/en/latest/reference/urllib3.connectionpool.html295.. _certifi: https://certifiio.readthedocs.io/296.. _Mozilla trust store: https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt297298.. _body-content-workflow:
366 unmodified lines
665 $ python666 >>> import requests667 >>> requests.get('https://example.org')668669.. _socks:670671SOCKS672^^^^^673674.. versionadded:: 2.10.0
272 unmodified lines
947948Many HTTP APIs feature Link headers. They make APIs more self describing and949discoverable.950949GitHub uses these for `pagination <https://developer.github.com/v3/#pagination>`_951GitHub uses these for `pagination <https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api>`_952in their API, for example::953954 >>> url = 'https://api.github.com/users/kennethreitz/repos?page=1&per_page=10'955 >>> r = requests.head(url=url)
142 unmodified lines
1098The **connect** timeout is the number of seconds Requests will wait for your1099client to establish a connection to a remote machine (corresponding to the1100`connect()`_) call on the socket. It's a good practice to set connect timeouts1101to slightly larger than a multiple of 3, which is the default `TCP packet1100retransmission window <https://www.hjp.at/doc/rfc/rfc2988.txt>`_.1102retransmission window <https://datatracker.ietf.org/doc/html/rfc2988>`_.11031104Once your client has connected to the server and sent the HTTP request, the1105**read** timeout is the number of seconds the client will wait for the server1106to send a response. (Specifically, it's the number of seconds that the client
16 unmodified lines
1123::11241125 r = requests.get('https://github.com', timeout=None)11261127.. note:: The connect timeout applies to each connection attempt to an IP address.1128 If multiple addresses exist for a domain name, the underlying ``urllib3`` will1129 try each address sequentially until one successfully connects.1130 This may lead to an effective total connection timeout *multiple* times longer1131 than the specified time, e.g. an unresponsive server having both IPv4 and IPv61132 addresses will have its perceived timeout *doubled*, so take that into account1133 when setting the connection timeout.1134.. note:: Neither the connect nor read timeouts are `wall clock`_. This means1135 that if you start a request, and look at the time, and then look at1136 the time when the request finishes or times out, the real-world time1137 may be greater than what you specified.113811391140.. _`wall clock`: https://wiki.php.net/rfc/max_execution_wall_time1141.. _`connect()`: https://linux.die.net/man/2/connect
modified:docs/user/quickstart.rst+2 added-3 removed
199 unmodified lines
200 transform the response content. If you really need access to the bytes as they201 were returned, use ``Response.raw``.202203204.. _custom-headers:205206Custom Headers207--------------208209If you'd like to add HTTP headers to a request, simply pass in a ``dict`` to the
357 unmodified lines
567568-----------------------569570Ready for more? Check out the :ref:`advanced <advanced>` section.569570571If you're on the job market, consider taking `this programming quiz <https://triplebyte.com/a/b1i2FB8/requests-docs-1>`_. A substantial donation will be made to this project, if you find a job through this platform.
modified:docs/index.rst+1 added-1 removed
70 unmodified lines
71- Connection Timeouts72- Chunked Requests73- ``.netrc`` Support7475Requests officially supports Python 3.7+, and runs great on PyPy.75Requests officially supports Python 3.8+, and runs great on PyPy.767778The User Guide79--------------
61 unmodified lines
modified:docs/requirements.txt+1 added-1 removed
1# Pinning to avoid unexpected breakages.2# Used by RTD to generate docs.3Sphinx==4.2.03Sphinx==7.2.6
modified:src/requests/__init__.py+5 added-1 removed
81 unmodified lines
82 major, minor, patch = int(major), int(minor), int(patch)83 # charset_normalizer >= 2.0.0 < 4.0.084 assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0)85 else:86 raise Exception("You need either charset_normalizer or chardet installed")86 warnings.warn(87 "Unable to find acceptable character detection dependency "88 "(chardet or charset_normalizer).",89 RequestsDependencyWarning,90 )919293def _check_cryptography(cryptography_version):94 # cryptography < 1.3.4
90 unmodified lines
modified:src/requests/__version__.py+2 added-2 removed
3 unmodified lines
45__title__ = "requests"6__description__ = "Python HTTP for Humans."7__url__ = "https://requests.readthedocs.io"8__version__ = "2.31.0"9__build__ = 0x0231008__version__ = "2.32.3"9__build__ = 0x02320310__author__ = "Kenneth Reitz"11__author_email__ = "me@kennethreitz.org"12__license__ = "Apache-2.0"13__copyright__ = "Copyright Kenneth Reitz"
1 unmodified line
modified:src/requests/adapters.py+200 added-18 removed
6 unmodified lines
7"""89import os.path10import socket # noqa: F40111import typing12import warnings1314from urllib3.exceptions import ClosedPoolError, ConnectTimeoutError15from urllib3.exceptions import HTTPError as _HTTPError16from urllib3.exceptions import InvalidHeader as _InvalidHeader
9 unmodified lines
26from urllib3.poolmanager import PoolManager, proxy_from_url27from urllib3.util import Timeout as TimeoutSauce28from urllib3.util import parse_url29from urllib3.util.retry import Retry30from urllib3.util.ssl_ import create_urllib3_context3132from .auth import _basic_auth_str33from .compat import basestring, urlparse34from .cookies import extract_cookies_to_jar
28 unmodified lines
63 def SOCKSProxyManager(*args, **kwargs):64 raise InvalidSchema("Missing dependencies for SOCKS support.")656667if typing.TYPE_CHECKING:68 from .models import PreparedRequest697071DEFAULT_POOLBLOCK = False72DEFAULT_POOLSIZE = 1073DEFAULT_RETRIES = 074DEFAULT_POOL_TIMEOUT = None757677try:78 import ssl # noqa: F4017980 _preloaded_ssl_context = create_urllib3_context()81 _preloaded_ssl_context.load_verify_locations(82 extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)83 )84except ImportError:85 # Bypass default SSLContext creation when Python86 # interpreter isn't built with the ssl module.87 _preloaded_ssl_context = None888990def _urllib3_request_context(91 request: "PreparedRequest",92 verify: "bool | str | None",93 client_cert: "typing.Tuple[str, str] | str | None",94 poolmanager: "PoolManager",95) -> "(typing.Dict[str, typing.Any], typing.Dict[str, typing.Any])":96 host_params = {}97 pool_kwargs = {}98 parsed_request_url = urlparse(request.url)99 scheme = parsed_request_url.scheme.lower()100 port = parsed_request_url.port101102 # Determine if we have and should use our default SSLContext103 # to optimize performance on standard requests.104 poolmanager_kwargs = getattr(poolmanager, "connection_pool_kw", {})105 has_poolmanager_ssl_context = poolmanager_kwargs.get("ssl_context")106 should_use_default_ssl_context = (107 _preloaded_ssl_context is not None and not has_poolmanager_ssl_context108 )109110 cert_reqs = "CERT_REQUIRED"111 if verify is False:112 cert_reqs = "CERT_NONE"113 elif verify is True and should_use_default_ssl_context:114 pool_kwargs["ssl_context"] = _preloaded_ssl_context115 elif isinstance(verify, str):116 if not os.path.isdir(verify):117 pool_kwargs["ca_certs"] = verify118 else:119 pool_kwargs["ca_cert_dir"] = verify120 pool_kwargs["cert_reqs"] = cert_reqs121 if client_cert is not None:122 if isinstance(client_cert, tuple) and len(client_cert) == 2:123 pool_kwargs["cert_file"] = client_cert[0]124 pool_kwargs["key_file"] = client_cert[1]125 else:126 # According to our docs, we allow users to specify just the client127 # cert path128 pool_kwargs["cert_file"] = client_cert129 host_params = {130 "scheme": scheme,131 "host": parsed_request_url.hostname,132 "port": port,133 }134 return host_params, pool_kwargs135136137class BaseAdapter:138 """The Base Transport Adapter"""139140 def __init__(self):
172 unmodified lines
313 to a CA bundle to use314 :param cert: The SSL certificate to verify.315 """316 if url.lower().startswith("https") and verify:250 cert_loc = None317 conn.cert_reqs = "CERT_REQUIRED"318252 # Allow self-specified cert location.319 # Only load the CA certificates if 'verify' is a string indicating the CA bundle to use.320 # Otherwise, if verify is a boolean, we don't load anything since321 # the connection will be using a context with the default certificates already loaded,322 # and this avoids a call to the slow load_verify_locations()323 if verify is not True:324 # `verify` must be a str with a path then325 cert_loc = verify326256 if not cert_loc:257 cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)327 if not os.path.exists(cert_loc):328 raise OSError(329 f"Could not find a suitable TLS CA certificate bundle, "330 f"invalid path: {cert_loc}"331 )332259 if not cert_loc or not os.path.exists(cert_loc):260 raise OSError(261 f"Could not find a suitable TLS CA certificate bundle, "262 f"invalid path: {cert_loc}"263 )264265 conn.cert_reqs = "CERT_REQUIRED"266267 if not os.path.isdir(cert_loc):268 conn.ca_certs = cert_loc269 else:270 conn.ca_cert_dir = cert_loc333 if not os.path.isdir(cert_loc):334 conn.ca_certs = cert_loc335 else:336 conn.ca_cert_dir = cert_loc337 else:338 conn.cert_reqs = "CERT_NONE"339 conn.ca_certs = None340 conn.ca_cert_dir = None
51 unmodified lines
392 response.connection = self393394 return response395396 def build_connection_pool_key_attributes(self, request, verify, cert=None):397 """Build the PoolKey attributes used by urllib3 to return a connection.398399 This looks at the PreparedRequest, the user-specified verify value,400 and the value of the cert parameter to determine what PoolKey values401 to use to select a connection from a given urllib3 Connection Pool.402403 The SSL related pool key arguments are not consistently set. As of404 this writing, use the following to determine what keys may be in that405 dictionary:406407 * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the408 default Requests SSL Context409 * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but410 ``"cert_reqs"`` will be set411 * If ``verify`` is a string, (i.e., it is a user-specified trust bundle)412 ``"ca_certs"`` will be set if the string is not a directory recognized413 by :py:func:`os.path.isdir`, otherwise ``"ca_certs_dir"`` will be414 set.415 * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If416 ``"cert"`` is a tuple with a second item, ``"key_file"`` will also417 be present418419 To override these settings, one may subclass this class, call this420 method and use the above logic to change parameters as desired. For421 example, if one wishes to use a custom :py:class:`ssl.SSLContext` one422 must both set ``"ssl_context"`` and based on what else they require,423 alter the other keys to ensure the desired behaviour.424425 :param request:426 The PreparedReqest being sent over the connection.427 :type request:428 :class:`~requests.models.PreparedRequest`429 :param verify:430 Either a boolean, in which case it controls whether431 we verify the server's TLS certificate, or a string, in which case it432 must be a path to a CA bundle to use.433 :param cert:434 (optional) Any user-provided SSL certificate for client435 authentication (a.k.a., mTLS). This may be a string (i.e., just436 the path to a file which holds both certificate and key) or a437 tuple of length 2 with the certificate file path and key file438 path.439 :returns:440 A tuple of two dictionaries. The first is the "host parameters"441 portion of the Pool Key including scheme, hostname, and port. The442 second is a dictionary of SSLContext related parameters.443 """444 return _urllib3_request_context(request, verify, cert, self.poolmanager)445446 def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):447 """Returns a urllib3 connection for the given request and TLS settings.448 This should not be called from user code, and is only exposed for use449 when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.450451 :param request:452 The :class:`PreparedRequest <PreparedRequest>` object to be sent453 over the connection.454 :param verify:455 Either a boolean, in which case it controls whether we verify the456 server's TLS certificate, or a string, in which case it must be a457 path to a CA bundle to use.458 :param proxies:459 (optional) The proxies dictionary to apply to the request.460 :param cert:461 (optional) Any user-provided SSL certificate to be used for client462 authentication (a.k.a., mTLS).463 :rtype:464 urllib3.ConnectionPool465 """466 proxy = select_proxy(request.url, proxies)467 try:468 host_params, pool_kwargs = self.build_connection_pool_key_attributes(469 request,470 verify,471 cert,472 )473 except ValueError as e:474 raise InvalidURL(e, request=request)475 if proxy:476 proxy = prepend_scheme_if_needed(proxy, "http")477 proxy_url = parse_url(proxy)478 if not proxy_url.host:479 raise InvalidProxyURL(480 "Please check proxy URL. It is malformed "481 "and could be missing the host."482 )483 proxy_manager = self.proxy_manager_for(proxy)484 conn = proxy_manager.connection_from_host(485 **host_params, pool_kwargs=pool_kwargs486 )487 else:488 # Only scheme should be lower case489 conn = self.poolmanager.connection_from_host(490 **host_params, pool_kwargs=pool_kwargs491 )492493 return conn494495 def get_connection(self, url, proxies=None):496 """DEPRECATED: Users should move to `get_connection_with_tls_context`497 for all subclasses of HTTPAdapter using Requests>=2.32.2.498331 """Returns a urllib3 connection for the given URL. This should not be499 Returns a urllib3 connection for the given URL. This should not be500 called from user code, and is only exposed for use when subclassing the501 :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.502503 :param url: The URL to connect to.504 :param proxies: (optional) A Requests-style dictionary of proxies used on this request.505 :rtype: urllib3.ConnectionPool506 """507 warnings.warn(508 (509 "`get_connection` has been deprecated in favor of "510 "`get_connection_with_tls_context`. Custom HTTPAdapter subclasses "511 "will need to migrate for Requests>=2.32.2. Please see "512 "https://github.com/psf/requests/pull/6710 for more details."513 ),514 DeprecationWarning,515 )516 proxy = select_proxy(url, proxies)517518 if proxy:519 proxy = prepend_scheme_if_needed(proxy, "http")
46 unmodified lines
566 proxy_scheme = urlparse(proxy).scheme.lower()567 using_socks_proxy = proxy_scheme.startswith("socks")568569 url = request.path_url570 if url.startswith("//"): # Don't confuse urllib3571 url = f"/{url.lstrip('/')}"572573 if is_proxied_http_request and not using_socks_proxy:574 url = urldefragauth(request.url)575576 return url
52 unmodified lines
629 :rtype: requests.Response630 """631632 try:453 conn = self.get_connection(request.url, proxies)633 conn = self.get_connection_with_tls_context(634 request, verify, proxies=proxies, cert=cert635 )636 except LocationValueError as e:637 raise InvalidURL(e, request=request)638639 self.cert_verify(conn, request.url, verify, cert)
80 unmodified lines
modified:src/requests/compat.py+20 added-5 removed
5 unmodified lines
6between Python 2 and Python 3. It remains for backwards7compatibility until the next major version.8"""910try:11 import chardet12except ImportError:13 import charset_normalizer as chardet1410import importlib11import sys1213# -------------------14# Character Detection15# -------------------161718def _resolve_char_detection():19 """Find supported character detection libraries."""20 chardet = None21 for lib in ("chardet", "charset_normalizer"):22 if chardet is None:23 try:24 chardet = importlib.import_module(lib)25 except ImportError:26 pass27 return chardet282930chardet = _resolve_char_detection()3132# -------33# Pythons34# -------35
59 unmodified lines
modified:src/requests/exceptions.py+10 added
39 unmodified lines
40 """41 CompatJSONDecodeError.__init__(self, *args)42 InvalidJSONError.__init__(self, *self.args, **kwargs)4344 def __reduce__(self):45 """46 The __reduce__ method called when pickling the object must47 be the one from the JSONDecodeError (be it json/simplejson)48 as it expects all the arguments for instantiation, not just49 one like the IOError, and the MRO would by default call the50 __reduce__ method from the IOError due to the inheritance order.51 """52 return CompatJSONDecodeError.__reduce__(self)535455class HTTPError(RequestException):56 """An HTTP error occurred."""5758
93 unmodified lines
modified:src/requests/models.py+6 added-1 removed
787 unmodified lines
788789 @property790 def apparent_encoding(self):791 """The apparent encoding, provided by the charset_normalizer or chardet libraries."""792 if chardet is not None:792 return chardet.detect(self.content)["encoding"]793 return chardet.detect(self.content)["encoding"]794 else:795 # If no character detection library is available, we'll fall back796 # to a standard Python utf-8 str.797 return "utf-8"798799 def iter_content(self, chunk_size=1, decode_unicode=False):800 """Iterates over the response data. When stream=True is set on the801 request, this avoids reading the content at once into memory for
236 unmodified lines
modified:src/requests/packages.py+9 added-14 removed
1import sys23try:4 import chardet3from .compat import chardet5except ImportError:6 import warnings48 import charset_normalizer as chardet910 warnings.filterwarnings("ignore", "Trying to detect", module="charset_normalizer")115# This code exists for backwards compatibility reasons.6# I don't like it either. Just look the other way. :)78for package in ("urllib3", "idna"):
3 unmodified lines
12 for mod in list(sys.modules):13 if mod == package or mod.startswith(f"{package}."):14 sys.modules[f"requests.packages.{mod}"] = sys.modules[mod]1516if chardet is not None:23target = chardet.__name__24for mod in list(sys.modules):25 if mod == target or mod.startswith(f"{target}."):26 target = target.replace(target, "chardet")27 sys.modules[f"requests.packages.{target}"] = sys.modules[mod]28# Kinda cool, though, right?17 target = chardet.__name__18 for mod in list(sys.modules):19 if mod == target or mod.startswith(f"{target}."):20 imported_mod = sys.modules[mod]21 sys.modules[f"requests.packages.{mod}"] = imported_mod22 mod = mod.replace(target, "chardet")23 sys.modules[f"requests.packages.{mod}"] = imported_mod
modified:src/requests/status_codes.py+5 added-5 removed
22 unmodified lines
23_codes = {24 # Informational.25 100: ("continue",),26 101: ("switching_protocols",),27 102: ("processing",),27 102: ("processing", "early-hints"),28 103: ("checkpoint",),29 122: ("uri_too_long", "request_uri_too_long"),30 200: ("ok", "okay", "all_ok", "all_okay", "all_good", "\\o/", "✓"),31 201: ("created",),
32 unmodified lines
64 409: ("conflict",),65 410: ("gone",),66 411: ("length_required",),67 412: ("precondition_failed", "precondition"),68 413: ("request_entity_too_large",),69 414: ("request_uri_too_large",),68 413: ("request_entity_too_large", "content_too_large"),69 414: ("request_uri_too_large", "uri_too_long"),70 415: ("unsupported_media_type", "unsupported_media", "media_type"),71 416: (72 "requested_range_not_satisfiable",73 "requested_range",
1 unmodified line
75 ),76 417: ("expectation_failed",),77 418: ("im_a_teapot", "teapot", "i_am_a_teapot"),78 421: ("misdirected_request",),79 422: ("unprocessable_entity", "unprocessable"),79 422: ("unprocessable_entity", "unprocessable", "unprocessable_content"),80 423: ("locked",),81 424: ("failed_dependency", "dependency"),82 425: ("unordered_collection", "unordered"),82 425: ("unordered_collection", "unordered", "too_early"),83 426: ("upgrade_required", "upgrade"),84 428: ("precondition_required", "precondition"),85 429: ("too_many_requests", "too_many"),86 431: ("header_fields_too_large", "fields_too_large"),
42 unmodified lines
modified:src/requests/utils.py+7 added-2 removed
95 unmodified lines
96 # make a check value list from the registry entry: replace the97 # '<local>' string by the localhost entry and the corresponding98 # canonical entry.99 proxyOverride = proxyOverride.split(";")100 # filter out empty strings to avoid re.match return true in the following code.101 proxyOverride = filter(None, proxyOverride)102 # now check if we match one of the registry values.103 for test in proxyOverride:104 if test == "<local>":105 if "." not in host:
29 unmodified lines
135def super_len(o):136 total_length = None137 current_position = 0138139 if isinstance(o, str):140 o = o.encode("utf-8")141142 if hasattr(o, "__len__"):143 total_length = len(o)144145 elif hasattr(o, "len"):
717 unmodified lines
863864def resolve_proxies(request, proxies, trust_env=True):865 """This method takes proxy information from a request and configuration866 input to resolve a mapping of target proxies. This will consider settings862 such a NO_PROXY to strip proxy configurations.867 such as NO_PROXY to strip proxy configurations.868869 :param request: Request or PreparedRequest870 :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs871 :param trust_env: Boolean declaring whether to trust environment configs
183 unmodified lines
10551056 if not validator.match(header_part):1057 header_kind = "name" if header_validator_index == 0 else "value"1058 raise InvalidHeader(1054 f"Invalid leading whitespace, reserved character(s), or return"1059 f"Invalid leading whitespace, reserved character(s), or return "1060 f"character(s) in header {header_kind}: {header_part!r}"1061 )10621063
33 unmodified lines
added:tests/certs/expired/ca/ca-private.key+28 added
1-----BEGIN PRIVATE KEY-----2MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDHlIhe7GLCeSk83RZOKdtmyKns6KdZgGw/LcxPkYvQlu1g0zV8X0DqVr2LdMumWUTNCc9sPdSlAG+He4mQp2TMoWUMumMuwDtit9RT0Sb6Eh9svWgjY9ferovPJRfCWUTsA2Ug8uoh0wyEXK5na7X6fHt5E3B9vj0+b9a4vDibdBXV11FheLT02/uEmAEJDdP/zeBgvVbhcVyumO66fAGMIWzR2ukhe8z/ma5H9zoi4gZA8nsK6reZUD8+6affnPe+jIt/AdzggtV9jkWm7zSpr+RHeZ0y+q4eik2ZNUGg4XcF6JsJ9yu/AqLBXxd38uLdFfgyhP2y6K628yzgy8e6lzFyWnAgMBAAECggEAFwzHhzcD3PQDWCus85PwZoxTeQ817BmUBGpBBOKM0gLG9GCsT7XsmGP2NjICBy9OK+QTKawmb/wR5XK0OMUWDHXqtWn+NFIyojyo8+HEeCf8n104ZleTFHLnJ+d2N1etbc2qc9mY3tjpaurq8/0Tol9YH06ock1TY2+lO+a5HvMURnY11hcWs70CamL+5B/6n67DhjzMtIW3dIXuEEceM1BW/jW8SKq0JHpQ3t+OJwID7zFaJ12bLyOwAVheMzVGvN3yphf8tll3tMA65bNjdOzgOfZSjAy7EGjW3DyAolDw9jKLRyu13E0gw/exNGe618oMIeUDv0KParlL4RjdiUP8l0xYOwQKBgQD3eYj9rWeqZquI9vKP14gaSv6urb2UJLngShZUpEZRNJgBO+Ewiof0w8tpQdsnuMvWudxMLbzgiUNA+NyC/K15CpzIXFkWnWx+A/pxs8ZO8moOfajVRayJgeOLsQZb7c4fXGsVGApbN4+cPNhTNG6d16ucErv6tae/SzAzcLc5Vkw/ELxwKBgQDOdJ5Wl5JeKAvU/3kF6+MYWCrXxZqMjoHS17y1BtyMX5RbdaWTCfDUu1aV3qJOJjjWQ9DJdJQcEsrTjOpD4bVdZx4w/XEG0JXAa318jRypVHGdeG/TjhUGJA8U+KX3a1DkcdqM9pqFYRw5Ie95Wz9YRroI+YkixqpK8d7W19C+5BodxXIQKBgCk8Lv9V7XgPM3XW8APJbk+BrTCEuu8unUbnQcCztssAdEmvkjnB20PErBgVyRaNTCmzPmnTFS20sWgaD2QkBAFG+uM4n5ISK+NvTLJ7fv3IwdlAw1V9Jx21uiCElrKqpTXEiHMzVkZss5ks6j6y9duCIBXSEhM5pERPvNRDphjsLTXxAoGARSNC22nyb1Kjjo9XR0V+pNy6pC9q1C+00B5tCVZ55zxe114Hi70pfGQcM+YxnlAoeoCNW923mBfAFDESNAlGjyrovIzYkiH7EcZSrYdBEOepgJ2DfWo4Wi0bK9+03K2AknAaS1iO24GJqTtAJMSuymwu40gKroJNA42Q40nKO0LyCARGECgYEAiFRHkblBtStv22SpZxNC25jim9yuM0ikh7Ij1lEHysc/GWb2RQNxQVk54BU2kQ0d9xwMZQTKvpF3VE9t7uGdwt26AasWPr/tWYt35Ud0D4bNlagJJ4Xdslf8n1nkq3qqqDQbd7kkQRgwGzVr0uVg7ZfS2726qSPQ0/aF9nagb5eHX3AuU=28-----END PRIVATE KEY-----
added:tests/certs/expired/ca/ca.cnf+12 added
1[req]2default_bits = 20483prompt = no4default_md = sha2565encrypt_key = no6distinguished_name = dn78[dn]9C = US # country code10O = Python Software Foundation # organization11OU = python-requests # organization unit/department12CN = Self-Signed Root CA # common name / your cert name
added:tests/certs/expired/ca/ca.crt+20 added
1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jH/MzKbfrx73QwsbPWiFmjzHopdasIO0lDlmgm/r9gKfkbzfKoGCgLZ196an6FlmLftLSXijf/QwtqeSP9fODeE3dzBmnTM3jdoVS53ZegUDWNl14o25v2Kg=20-----END CERTIFICATE-----
added:tests/certs/expired/ca/ca.srl+1 added
14F36C3A7E075BA6452D10EEB81E7F189FF489B74
added:tests/certs/expired/ca/Makefile+13 added
1.PHONY: all clean23root_files = ca-private.key ca.crt45ca-private.key:6 openssl genrsa -out ca-private.key 204878all: ca-private.key9 openssl req -x509 -sha256 -days 7300 -key ca-private.key -out ca.crt -config ca.cnf10 ln -s ca.crt cacert.pem1112clean:13 rm -f cacert.pem ca.crt ca-private.key *.csr
added:tests/certs/expired/server/cert.cnf+24 added
1[req]2req_extensions = v3_req3distinguished_name = req_distinguished_name4prompt=no56[req_distinguished_name]7C = US8ST = DE9O = Python Software Foundation10OU = python-requests11CN = localhost1213[v3_req]14# Extensions to add to a certificate request15basicConstraints = CA:FALSE16keyUsage = digitalSignature, keyEncipherment17extendedKeyUsage = serverAuth18subjectAltName = @alt_names1920[alt_names]21DNS.1 = *.localhost22DNS.1 = localhost23IP.1 = 127.0.0.124IP.2 = ::1
added:tests/certs/expired/server/Makefile+16 added
1.PHONY: all clean23server.key:4 openssl genrsa -out $@ 204856server.csr: server.key7 openssl req -key $< -new -out $@ -config cert.cnf89server.pem: server.csr10 openssl x509 -req -CA ../ca/ca.crt -CAkey ../ca/ca-private.key -in server.csr -outform PEM -out server.pem -days 0 -CAcreateserial11 openssl x509 -in ../ca/ca.crt -outform PEM >> $@1213all: server.pem1415clean:16 rm -f server.*
added:tests/certs/expired/server/server.csr+19 added
1-----BEGIN CERTIFICATE REQUEST-----2MIIDHjCCAgYCAQAwbTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkRFMSMwIQYDVQQK3DBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEYMBYGA1UECwwPcHl0aG9uLXJl4cXVlc3RzMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB5DwAwggEKAoIBAQCKulIMpo633iCgbkKv1UoiLC4sQt5xWpgguujywu3hLYwmPFp96kvPt//imqtl8FhuhKqJ8FCGrVl2YIGj1RJIB3GW7MSPNCuIBFL/gwNi35LxDPtoA7IPyXytIR7VH9+ch9DFInJaoA/BekMuKvbXk54VW9whpHbwkXSG2lBS2vKL0XemYh89VjvtuRDji2iOZpznlVE2PEN80bojArp6oYKakv2kYzgzgxAJiI/NZGvC7mbSI4e9ja7ad3R9G0kB1FzNj36jrNO5WtxHO/mrRiXSpDeyUbitYvt0HKoM0vhTnOR+BspP10IltfwOQh8qq2Q2AaMHNcVjMH3gHCZADfhk/zAgMBAAGgbDBqBgkqhkiG9w0BCQ4x11XTBbMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMB12MCwGA1UdEQQlMCOCCWxvY2FsaG9zdIcEfwAAAYcQAAAAAAAAAAAAAAAAAAAAATAN13BgkqhkiG9w0BAQsFAAOCAQEAfAhEhrulsZae71YFqgvzwJHm/hzXh47hErtgDXVJ14mFqAxgF6XrnzYujlt3XQXUx/8vdrU7jH+Pe8WO1rDvFwRPMDGoBF3RX29SzyX/2F15e102egnoRR+Hlf0Ixqu0CuTjEVnD+g4mRgXhV7LPKP4W6qGwzcVbaJ3c/zRcfqNR16g9gN6Q6Qt4fXDc7wlx2T3nOszBLQ2XCsIyzVtOJ2sSuadqKH9Aj+mrkrLBdzVFHD17FHnTMJ0t0+anZwd+AWDNsCr5lIwBGL634zw7/yJepMHuPFd2X24S3u8EaWPkfVQn18lV6rLQMGjXYTe2xuYzlUCUYnKvkyPTMjSXDkxWa+WSNwyQ==19-----END CERTIFICATE REQUEST-----
added:tests/certs/expired/server/server.key+28 added
1-----BEGIN PRIVATE KEY-----2MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCKulIMpo633iCg3bkKv1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IuseKAw8hlBwbtiRyVZt8GZD9zyQuy20k+g02tUWYk0XyXN65LX4bwURkZyMJIeWKZGNsaW1YnzturDQB5tZ4g/zBIoCWkHA21aVQAaimIPk3a3foiD5NQVUdckfEp0GVPOsSGg5R6EO23+i8mxPXnDW1OqQKBgGvf22lelTO8tyLFdAOcqBUt6rZ/1499p3snaAZ6bSqvk95dYnr0h48y5AQaln/FiaIYg423HyLZsZ4S18jFXSWYkWOyNeQP6yafciBWY5StT0TN52VaoX3+8McGXKUHAcVjHbLZ24ou2wpP6jmKyQJVQaF9LOT9uAMOMbOFrrnQLBjmfxAoGAQAnUhMFG5mwi9Otxt6Mz25g+Gr+3JTlzwC3L7UwGdlFc3G2vSdGx/yOrfzpxPImfIBS95mibDfdvEBMer26pvw26a/ycqybyX9d/5nPDIaJ1lc4M4cbHC/cB52JI6avr/1g8OMK7lR7b/FsPVHS1w8kl27n6uwEjVt2+gP2o9DFTGs158=28-----END PRIVATE KEY-----
added:tests/certs/expired/server/server.pem+41 added
1-----BEGIN CERTIFICATE-----2MIIDXjCCAkYCFE82w6fgdbpkUtEO64Hn8Yn/SJt0MA0GCSqGSIb3DQEBCwUAMGox3CzAJBgNVBAYTAlVTMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlv4bjEYMBYGA1UECwwPcHl0aG9uLXJlcXVlc3RzMRwwGgYDVQQDDBNTZWxmLVNpZ25l5ZCBSb290IENBMB4XDTI0MDMxMzIxMTQ0NVoXDTI0MDMxMzIxMTQ0NVowbTELMAkG6A1UEBhMCVVMxCzAJBgNVBAgMAkRFMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUg7Rm91bmRhdGlvbjEYMBYGA1UECwwPcHl0aG9uLXJlcXVlc3RzMRIwEAYDVQQDDAls8b2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCKulIMpo6393iCgbkKv1UoiLC4sQt5xWpgguujywu3hLYwmPFp9kvPt//imqtl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lnbmVkIFJv29b3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHlIhe7GLCeSk830RZOKdtmyKns6KdZgGw/LcxPkYvQlu1g0zV8X0DqVr2LdMumWUTNCc9sPdSlAG+He31mQp2TMoWUMumMuwDtit9RT0Sb6Eh9svWgjY9ferovPJRfCWUTsA2Ug8uoh0wyEXK32na7X6fHt5E3B9vj0+b9a4vDibdBXV11FheLT02/uEmAEJDdP/zeBgvVbhcVyumO633fAGMIWzR2ukhe8z/ma5H9zoi4gZA8nsK6reZUD8+6affnPe+jIt/AdzggtV9jkWm34zSpr+RHeZ0y+q4eik2ZNUGg4XcF6JsJ9yu/AqLBXxd38uLdFfgyhP2y6K628yzgy35e6lzFyWnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGymNVTsKSAq8Ju6zV+AWAyV36GcUNBmLpgzDA0e7pkVYhHTdWKlGH4GnrRcp0nvnSbr6iq1Ob/8yEUUoRzK55Flws37Kt1OLwnZyhfRoSUesoEqpP68vzWEgiYv0QuIWvzNt0YfAAvEgGoc3iri44MelKLn389ZMT8m91nVamA35R8ZjfeAkNp2xcz0a67V0ww6o4wSXrG7o5ZRXyjqZ/9K7SfwUJ39rV9RciccsjH/MzKbfrx73QwsbPWiFmjzHopdasIO0lDlmgm/r9gKfkbzfKoGCgLZ406an6FlmLftLSXijf/QwtqeSP9fODeE3dzBmnTM3jdoVS53ZegUDWNl14o25v2Kg=41-----END CERTIFICATE-----
added:tests/certs/expired/Makefile+13 added
1.PHONY: all clean ca server23ca:4 make -C $@ all56server:7 make -C $@ all89all: ca server1011clean:12 make -C ca clean13 make -C server clean
added:tests/certs/expired/README.md+11 added
1# Expired Certificates and Configuration for Testing23This has a valid certificate authority in [ca](./ca) and an invalid server4certificate in [server](./server).56This can all be regenerated with:78```9make clean10make all11```
added:tests/certs/mtls/client/ca+1 added
1../../expired/ca/
added:tests/certs/mtls/client/cert.cnf+26 added
1[req]2req_extensions = v3_req3distinguished_name = req_distinguished_name4prompt=no56[req_distinguished_name]7C = US8ST = DE9O = Python Software Foundation10OU = python-requests11CN = requests1213[v3_req]14# Extensions to add to a certificate request15basicConstraints = CA:FALSE16keyUsage = digitalSignature, keyEncipherment17extendedKeyUsage = clientAuth18subjectAltName = @alt_names1920[alt_names]21DNS.1 = *.localhost22IP.1 = 127.0.0.123IP.2 = ::124URI.1 = spiffe://trust.python.org/v0/maintainer/sigmavirus24/project/requests/org/psf25URI.2 = spiffe://trust.python.org/v1/maintainer:sigmavirus24/project:requests/org:psf26URI.3 = spiffe://trust.python.org/v1/maintainer=sigmavirus24/project=requests/org=psf
added:tests/certs/mtls/client/client.csr+24 added
1-----BEGIN CERTIFICATE REQUEST-----2MIIEGjCCAwICAQAwbDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkRFMSMwIQYDVQQK3DBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEYMBYGA1UECwwPcHl0aG9uLXJl4cXVlc3RzMREwDwYDVQQDDAhyZXF1ZXN0czCCASIwDQYJKoZIhvcNAQEBBQADggEP5ADCCAQoCggEBAMn3iQycTjUzpKJChRNkcm33UB282cUwpxeqKN4ahHxBpS09HRhk6cQYO7yErEUQwzQnBQEcIpzzeIMZIqHuCkgnySjeEJd95AIzNzGyoLLkS51TcJwgR7v83AvT8ljA88s9h38qGTy4/TCxJgf76pfHIuC1qoKVQh3AuHj9nOxIZLUsrdDbWF8WoLqKSVyTby+RXvSAppAR+cuBCaWStQ6xFORn48RHfc6t30ggD4rDAjyU6Vz6oR89ot3XmGdK0h42UdqidUWkRJajEbpkCnQSXS21IvfXKxF5sFqAXJrj9iVbUfpNPpaa10W8IrHByngyV8amazGZrASstUVRFtWrnrcWECAwEAAaCCAWcwggFjBgkqhkiG9w0B11CQ4xggFUMIIBUDAJBgNVHRMEAjAAMAsGA1UdDwQEAwIFoDATBgNVHSUEDDAKBggr12BgEFBQcDAjCCAR8GA1UdEQSCARYwggESggsqLmxvY2FsaG9zdIcEfwAAAYcQAAAA13AAAAAAAAAAAAAAAAAYZNc3BpZmZlOi8vdHJ1c3QucHl0aG9uLm9yZy92MC9tYWlu14dGFpbmVyL3NpZ21hdmlydXMyNC9wcm9qZWN0L3JlcXVlc3RzL29yZy9wc2aGTXNw15aWZmZTovL3RydXN0LnB5dGhvbi5vcmcvdjEvbWFpbnRhaW5lcjpzaWdtYXZpcnVz16MjQvcHJvamVjdDpyZXF1ZXN0cy9vcmc6cHNmhk1zcGlmZmU6Ly90cnVzdC5weXRo17b24ub3JnL3YxL21haW50YWluZXI9c2lnbWF2aXJ1czI0L3Byb2plY3Q9cmVxdWVz18dHMvb3JnPXBzZjANBgkqhkiG9w0BAQsFAAOCAQEAwP1KJ+Evddn2RV1FM6BFkoDK19MPDO9qwb8ea3j57SIJXZlpw168DljmuGzxJw9oys2O6FYcspbHIocAkfFwiYgVAr20NEog6xlCdPxNBJgC3YFIKwnmBjMPG6ZCWiJn940qTbaJ/j6ZviN17uW4K7Sl+THp21IkMv29uQTWkfg+GbZ9q1hm2m2GHhYLGLAUdJdtv7JI+yq5uxdsWaCANpH6kc8SnK222rik6D3iItDhHCmToHBpdEnP8J+KDzf5pJrv/g3WH8XVrl4ZzBsOhmciWF4C3Hbf239eu8eAsp1AsIrZOEGTfClBd7vFCES5DmI0/iRs4czQooqZPnHjOw3Azp/LujrA==24-----END CERTIFICATE REQUEST-----
added:tests/certs/mtls/client/client.key+28 added
1-----BEGIN PRIVATE KEY-----2MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDJ94kMnE41M6Si3QoUTZHJt91AdvNnFMKcXqijeGoR8QaUtPR0YZHEGDu8hKxFEMM0JwUBHCKc83iDG4SKh7gpIJ8ko3hCXfeQCMzcxsqCy5EudU3CcIEb/NwL0/JYwPPLPYd/Khk8uP0wsS5YH++qXxyLgtaqClUIdwLh4/ZzsSGS1LK3Q21hVqC6iklck28vkV70gKaQEfnLgQm6lkrUOsRTkZ+PER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hjAIz237nULsLS5YLx8BWmjjV3106dYP3hut4KsXGF4iSjTnts25J27tA4DUeUrKrF2QVyT24s9qfNvCw+Np/J0Uku3e33/3iWdpcVL9vIS5C5/0CgYBEuxb3dffNRqEiNkpOUrCD25mQTqbO3X+hin9zT3GrxQE+7KpfCfdDIqdK6c5UWHirR3HUjUPZmIFLSx8msfLl3k26hgQw37NMV+asg0Wy3P908qbtnEA2P6aDOMQeHJoC7qEHIDOcOQ1KP3FMvOrdscwS27f0IIDygTH6fYr329s0iXjg==28-----END PRIVATE KEY-----
added:tests/certs/mtls/client/client.pem+41 added
1-----BEGIN CERTIFICATE-----2MIIDXTCCAkUCFE82w6fgdbpkUtEO64Hn8Yn/SJtzMA0GCSqGSIb3DQEBCwUAMGox3CzAJBgNVBAYTAlVTMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlv4bjEYMBYGA1UECwwPcHl0aG9uLXJlcXVlc3RzMRwwGgYDVQQDDBNTZWxmLVNpZ25l5ZCBSb290IENBMB4XDTI0MDMxMzE4MzUwNFoXDTI2MDMxMzE4MzUwNFowbDELMAkG6A1UEBhMCVVMxCzAJBgNVBAgMAkRFMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUg7Rm91bmRhdGlvbjEYMBYGA1UECwwPcHl0aG9uLXJlcXVlc3RzMREwDwYDVQQDDAhy8ZXF1ZXN0czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMn3iQycTjUz9pKJChRNkcm33UB282cUwpxeqKN4ahHxBpS09HRhkcQYO7yErEUQwzQnBQEcIpzze10IMZIqHuCkgnySjeEJd95AIzNzGyoLLkS51TcJwgRv83AvT8ljA88s9h38qGTy4/T11CxJgf76pfHIuC1qoKVQh3AuHj9nOxIZLUsrdDbWFWoLqKSVyTby+RXvSAppAR+cu12BCaWStQ6xFORn48RHfc6t30ggD4rDAjyU6Vz6oR8ot3XmGdK0h42UdqidUWkRJaj13EbpkCnQSXS21IvfXKxF5sF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a4vDibdBXV11FheLT02/uEmAEJDdP/zeBgvVbhcVyumO633fAGMIWzR2ukhe8z/ma5H9zoi4gZA8nsK6reZUD8+6affnPe+jIt/AdzggtV9jkWm34zSpr+RHeZ0y+q4eik2ZNUGg4XcF6JsJ9yu/AqLBXxd38uLdFfgyhP2y6K628yzgy35e6lzFyWnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGymNVTsKSAq8Ju6zV+AWAyV36GcUNBmLpgzDA0e7pkVYhHTdWKlGH4GnrRcp0nvnSbr6iq1Ob/8yEUUoRzK55Flws37Kt1OLwnZyhfRoSUesoEqpP68vzWEgiYv0QuIWvzNt0YfAAvEgGoc3iri44MelKLn389ZMT8m91nVamA35R8ZjfeAkNp2xcz0a67V0ww6o4wSXrG7o5ZRXyjqZ/9K7SfwUJ39rV9RciccsjH/MzKbfrx73QwsbPWiFmjzHopdasIO0lDlmgm/r9gKfkbzfKoGCgLZ406an6FlmLftLSXijf/QwtqeSP9fODeE3dzBmnTM3jdoVS53ZegUDWNl14o25v2Kg=41-----END CERTIFICATE-----
added:tests/certs/mtls/client/Makefile+16 added
1.PHONY: all clean23client.key:4 openssl genrsa -out $@ 204856client.csr: client.key7 openssl req -key $< -new -out $@ -config cert.cnf89client.pem: client.csr10 openssl x509 -req -CA ./ca/ca.crt -CAkey ./ca/ca-private.key -in client.csr -outform PEM -out client.pem -days 730 -CAcreateserial11 openssl x509 -in ./ca/ca.crt -outform PEM >> $@1213all: client.pem1415clean:16 rm -f client.*
added:tests/certs/mtls/Makefile+7 added
1.PHONY: all clean23all:4 make -C client all56clean:7 make -C client clean
added:tests/certs/mtls/README.md+4 added
1# Certificate Examples for mTLS23This has some generated certificates for mTLS utilization. The idea is to be4able to have testing around how Requests handles client certificates.
added:tests/certs/valid/server/cert.cnf+31 added
1[req]2req_extensions = v3_req3distinguished_name = req_distinguished_name4prompt=no56[req_distinguished_name]7C = US8ST = DE9O = Python Software Foundation10OU = python-requests11CN = localhost1213[v3_req]14# Extensions to add to a certificate request15basicConstraints = critical, CA:FALSE16keyUsage = critical, digitalSignature, keyEncipherment17extendedKeyUsage = critical, serverAuth18subjectAltName = critical, @alt_names1920[v3_ca]21# Extensions to add to a certificate request22basicConstraints = critical, CA:FALSE23keyUsage = critical, digitalSignature, keyEncipherment24extendedKeyUsage = critical, serverAuth25subjectAltName = critical, @alt_names2627[alt_names]28DNS.1 = *.localhost29DNS.1 = localhost30IP.1 = 127.0.0.131IP.2 = ::1
added:tests/certs/valid/server/Makefile+16 added
1.PHONY: all clean23server.key:4 openssl genrsa -out $@ 204856server.csr: server.key7 openssl req -key $< -config cert.cnf -new -out $@89server.pem: server.csr10 openssl x509 -req -CA ../ca/ca.crt -CAkey ../ca/ca-private.key -in server.csr -outform PEM -out server.pem -extfile cert.cnf -extensions v3_ca -days 7200 -CAcreateserial11 openssl x509 -in ../ca/ca.crt -outform PEM >> $@1213all: server.pem1415clean:16 rm -f server.*
added:tests/certs/valid/server/server.csr+19 added
1-----BEGIN CERTIFICATE REQUEST-----2MIIDKjCCAhICAQAwbTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkRFMSMwIQYDVQQK3DBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEYMBYGA1UECwwPcHl0aG9uLXJl4cXVlc3RzMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB5DwAwggEKAoIBAQChEKOx377ymuDg23By5Re1DHi2RiBKSHr85/ZTZuwP/69lHN7q6TQEO//EMEFZ9+ZwezeJJsejjP2HO5lQZbcsWok3hbM0wVT+vApkogPvJ8WNFFWFe7ZBnGLi/1WM9cSZpUsDJ0XCsG0RTtO27wfgZQlKQMZxTkfi971oPYxNVSjTm2JcLT8kvwYIwxjJXPDTOgRo9TEAY3cWkCrBJN4w74GWBTM5KDDA230T7WwLuv81XD2LvYj9YYdMBGcxPr5tYTIlp3LncbcrDRNk3pbYQk0bRJgkw2vUkteiRGjkt+dgVnLc6+MI10W+VLXEpj+zsOZ5/R4d1pofqj9sDyDPhtNr1JAgMBAAGgeDB2BgkqhkiG9w0BCQ4x11aTBnMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgWgMBYGA1UdJQEB/wQMMAoG12CCsGAQUFBwMBMC8GA1UdEQEB/wQlMCOCCWxvY2FsaG9zdIcEfwAAAYcQAAAAAAAA13AAAAAAAAAAAAATANBgkqhkiG9w0BAQsFAAOCAQEAFTlFTn5Mn8JXtqB5bGjuiChe14ClA6Y32Co4l7N0CtAlf+bExwLdpLOleTX3WnryIPALl9uBUI/67dy/STn/J1Yn8615jWPEFwpmYNSKgQljYWcwtBdYLWfIsJO11kKdaAkOUHBEN5DKrXJ46Vs4918bD1/Q166ztqdrThiKc646u9xB58Hg7F0IyMWbHfs0x16ZpcN9otrIkbqOE2wzTmc65O1t1i17HDljcSk7OnNy3a9wtLEnyPiyMqHf2k/bTlmiDRVe3cSy9xieoqmzHTnOCSASe1y9187lcEBQild18Jo4nACV4vCYOUwrMi/58LWW+lD6OmMnPiWUqOvMbgMffMNDpWPA==19-----END CERTIFICATE REQUEST-----
added:tests/certs/valid/server/server.key+28 added
1-----BEGIN PRIVATE KEY-----2MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQChEKOx377ymuDg323By5Re1DHi2RiBKSHr85/ZTZuwP/69lHN7qTQEO//EMEFZ9+ZwezeJJsejjP2HO45lQZbcsWok3hbM0wVT+vApkogPvJ8WNFFWFeZBnGLi/1WM9cSZpUsDJ0XCsG0RTt5O27wfgZQlKQMZxTkfi971oPYxNVSjTm2JcLTkvwYIwxjJXPDTOgRo9TEAY3cWkCr6BJN4w74GWBTM5KDDA230T7WwLuv81XD2LvYjYYdMBGcxPr5tYTIlp3LncbcrDRNk73pbYQk0bRJgkw2vUkteiRGjkt+dgVnLc6+MIW+VLXEpj+zsOZ5/R4d1pofqj9sDy8DPhtNr1JAgMBAAECggEAIuLzBfXgCvXzlBjL2kMXd7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MRgw34FgYDVQQLDA9weXRob24tcmVxdWVzdHMxHDAaBgNVBAMME1NlbGYtU2lnbmVkIFJv35b3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHlIhe7GLCeSk836RZOKdtmyKns6KdZgGw/LcxPkYvQlu1g0zV8X0DqVr2LdMumWUTNCc9sPdSlAG+He37mQp2TMoWUMumMuwDtit9RT0Sb6Eh9svWgjY9ferovPJRfCWUTsA2Ug8uoh0wyEXK38na7X6fHt5E3B9vj0+b9a4vDibdBXV11FheLT02/uEmAEJDdP/zeBgvVbhcVyumO639fAGMIWzR2ukhe8z/ma5H9zoi4gZA8nsK6reZUD8+6affnPe+jIt/AdzggtV9jkWm40zSpr+RHeZ0y+q4eik2ZNUGg4XcF6JsJ9yu/AqLBXxd38uLdFfgyhP2y6K628yzgy41e6lzFyWnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGymNVTsKSAq8Ju6zV+AWAyV42GcUNBmLpgzDA0e7pkVYhHTdWKlGH4GnrRcp0nvnSbr6iq1Ob/8yEUUoRzK55Flws43Kt1OLwnZyhfRoSUesoEqpP68vzWEgiYv0QuIWvzNt0YfAAvEgGoc3iri44MelKLn449ZMT8m91nVamA35R8ZjfeAkNp2xcz0a67V0ww6o4wSXrG7o5ZRXyjqZ/9K7SfwUJ45rV9RciccsjH/MzKbfrx73QwsbPWiFmjzHopdasIO0lDlmgm/r9gKfkbzfKoGCgLZ466an6FlmLftLSXijf/QwtqeSP9fODeE3dzBmnTM3jdoVS53ZegUDWNl14o25v2Kg=47-----END CERTIFICATE-----
added:tests/certs/valid/ca+1 added
1../expired/ca
added:tests/certs/README.md+10 added
1# Testing Certificates23This is a collection of certificates useful for testing aspects of Requests'4behaviour.56The certificates include:78* [expired](./expired) server certificate with a valid certificate authority9* [mtls](./mtls) provides a valid client certificate with a 2 year validity10* [valid](./valid) has a valid server certificate
modified:tests/testserver/server.py+42 added
1import select2import socket3import ssl4import threading567def consume_socket_content(sock, timeout=0.5):
124 unmodified lines
132 # ensure server thread doesn't get stuck waiting for connections133 self._close_server_sock_ignore_errors()134 self.join()135 return False # allow exceptions to propagate136137138class TLSServer(Server):139 def __init__(140 self,141 *,142 handler=None,143 host="localhost",144 port=0,145 requests_to_handle=1,146 wait_to_close_event=None,147 cert_chain=None,148 keyfile=None,149 mutual_tls=False,150 cacert=None,151 ):152 super().__init__(153 handler=handler,154 host=host,155 port=port,156 requests_to_handle=requests_to_handle,157 wait_to_close_event=wait_to_close_event,158 )159 self.cert_chain = cert_chain160 self.keyfile = keyfile161 self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)162 self.ssl_context.load_cert_chain(self.cert_chain, keyfile=self.keyfile)163 self.mutual_tls = mutual_tls164 self.cacert = cacert165 if mutual_tls:166 # For simplicity, we're going to assume that the client cert is167 # issued by the same CA as our Server certificate168 self.ssl_context.verify_mode = ssl.CERT_OPTIONAL169 self.ssl_context.load_verify_locations(self.cacert)170171 def _create_socket_and_bind(self):172 sock = socket.socket()173 sock = self.ssl_context.wrap_socket(sock, server_side=True)174 sock.bind((self.host, self.port))175 sock.listen()176 return sock
added:tests/test_adapters.py+8 added
1import requests.adapters234def test_request_url_trims_leading_path_separators():5 """See also https://github.com/psf/requests/issues/6643."""6 a = requests.adapters.HTTPAdapter()7 p = requests.Request(method="GET", url="http://127.0.0.1:10000//v:h").prepare()8 assert "/v:h" == a.request_url(p, {})
modified:tests/test_requests.py+182 added-3 removed
5 unmodified lines
6import json7import os8import pickle9import re10import threading11import warnings12from unittest import mock1314import pytest
36 unmodified lines
51from requests.structures import CaseInsensitiveDict5253from . import SNIMissingWarning54from .compat import StringIO55from .testserver.server import TLSServer, consume_socket_content56from .utils import override_environ5758# Requests to this URL should always fail with a connection timeout (nothing59# listening on that port)
942 unmodified lines
1002 "InsecurePlatformWarning",1003 "SubjectAltNameWarning",1004 )10051004 with pytest.warns(None) as warning_records:1006 with pytest.warns() as warning_records:1007 warnings.simplefilter("always")1008 requests.get(f"https://localhost:{port}/", verify=ca_bundle)10091010 warning_records = [
692 unmodified lines
1703 "qux": "1",1704 }1705 r = requests.get(httpbin("get"), headers=valid_headers)1706 for key in valid_headers.keys():1705 valid_headers[key] == r.request.headers[key]1707 assert valid_headers[key] == r.request.headers[key]17081709 @pytest.mark.parametrize(1710 "invalid_header, key",1711 (
97 unmodified lines
1809 p = req.prepare()18101811 assert p.headers["Content-Length"] == length18121813 def test_content_length_for_bytes_data(self, httpbin):1814 data = "This is a string containing multi-byte UTF-8 ☃️"1815 encoded_data = data.encode("utf-8")1816 length = str(len(encoded_data))1817 req = requests.Request("POST", httpbin("post"), data=encoded_data)1818 p = req.prepare()18191820 assert p.headers["Content-Length"] == length18211822 def test_content_length_for_string_data_counts_bytes(self, httpbin):1823 data = "This is a string containing multi-byte UTF-8 ☃️"1824 length = str(len(data.encode("utf-8")))1825 req = requests.Request("POST", httpbin("post"), data=data)1826 p = req.prepare()18271828 assert p.headers["Content-Length"] == length18291830 def test_nonhttp_schemes_dont_check_URLs(self):1831 test_urls = (1832 "data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==",1833 "file:///etc/passwd",
886 unmodified lines
2720 r = requests.Request("GET", url=url)2721 with pytest.raises(requests.exceptions.InvalidURL):2722 r.prepare()27232705 @pytest.mark.parametrize("url, exception", (("http://localhost:-1", InvalidURL),))2724 @pytest.mark.parametrize("url, exception", (("http://:1", InvalidURL),))2725 def test_redirecting_to_bad_url(self, httpbin, url, exception):2726 with pytest.raises(exception):2727 requests.get(httpbin("redirect-to"), params={"url": url})2728
84 unmodified lines
2813 r = requests.get(httpbin("bytes/20"))2814 with pytest.raises(requests.exceptions.JSONDecodeError) as excinfo:2815 r.json()2816 assert excinfo.value.doc == r.text28172818 def test_status_code_425(self):2819 r1 = requests.codes.get("TOO_EARLY")2820 r2 = requests.codes.get("too_early")2821 r3 = requests.codes.get("UNORDERED")2822 r4 = requests.codes.get("unordered")2823 r5 = requests.codes.get("UNORDERED_COLLECTION")2824 r6 = requests.codes.get("unordered_collection")28252826 assert r1 == 4252827 assert r2 == 4252828 assert r3 == 4252829 assert r4 == 4252830 assert r5 == 4252831 assert r6 == 42528322833 def test_different_connection_pool_for_tls_settings_verify_True(self):2834 def response_handler(sock):2835 consume_socket_content(sock, timeout=0.5)2836 sock.send(2837 b"HTTP/1.1 200 OK\r\n"2838 b"Content-Length: 18\r\n\r\n"2839 b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'2840 )28412842 s = requests.Session()2843 close_server = threading.Event()2844 server = TLSServer(2845 handler=response_handler,2846 wait_to_close_event=close_server,2847 requests_to_handle=3,2848 cert_chain="tests/certs/expired/server/server.pem",2849 keyfile="tests/certs/expired/server/server.key",2850 )28512852 with server as (host, port):2853 url = f"https://{host}:{port}"2854 r1 = s.get(url, verify=False)2855 assert r1.status_code == 20028562857 # Cannot verify self-signed certificate2858 with pytest.raises(requests.exceptions.SSLError):2859 s.get(url)28602861 close_server.set()2862 assert 2 == len(s.adapters["https://"].poolmanager.pools)28632864 def test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert(2865 self,2866 ):2867 def response_handler(sock):2868 consume_socket_content(sock, timeout=0.5)2869 sock.send(2870 b"HTTP/1.1 200 OK\r\n"2871 b"Content-Length: 18\r\n\r\n"2872 b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'2873 )28742875 s = requests.Session()2876 close_server = threading.Event()2877 server = TLSServer(2878 handler=response_handler,2879 wait_to_close_event=close_server,2880 requests_to_handle=3,2881 cert_chain="tests/certs/expired/server/server.pem",2882 keyfile="tests/certs/expired/server/server.key",2883 )28842885 with server as (host, port):2886 url = f"https://{host}:{port}"2887 r1 = s.get(url, verify=False)2888 assert r1.status_code == 20028892890 # Has right trust bundle, but certificate expired2891 with pytest.raises(requests.exceptions.SSLError):2892 s.get(url, verify="tests/certs/expired/ca/ca.crt")28932894 close_server.set()2895 assert 2 == len(s.adapters["https://"].poolmanager.pools)28962897 def test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert(2898 self,2899 ):2900 def response_handler(sock):2901 consume_socket_content(sock, timeout=0.5)2902 sock.send(2903 b"HTTP/1.1 200 OK\r\n"2904 b"Content-Length: 18\r\n\r\n"2905 b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'2906 )29072908 s = requests.Session()2909 close_server = threading.Event()2910 server = TLSServer(2911 handler=response_handler,2912 wait_to_close_event=close_server,2913 requests_to_handle=3,2914 cert_chain="tests/certs/valid/server/server.pem",2915 keyfile="tests/certs/valid/server/server.key",2916 )29172918 with server as (host, port):2919 url = f"https://{host}:{port}"2920 r1 = s.get(url, verify=False)2921 assert r1.status_code == 20029222923 r2 = s.get(url, verify="tests/certs/valid/ca/ca.crt")2924 assert r2.status_code == 20029252926 close_server.set()2927 assert 2 == len(s.adapters["https://"].poolmanager.pools)29282929 def test_different_connection_pool_for_mtls_settings(self):2930 client_cert = None29312932 def response_handler(sock):2933 nonlocal client_cert2934 client_cert = sock.getpeercert()2935 consume_socket_content(sock, timeout=0.5)2936 sock.send(2937 b"HTTP/1.1 200 OK\r\n"2938 b"Content-Length: 18\r\n\r\n"2939 b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'2940 )29412942 s = requests.Session()2943 close_server = threading.Event()2944 server = TLSServer(2945 handler=response_handler,2946 wait_to_close_event=close_server,2947 requests_to_handle=2,2948 cert_chain="tests/certs/expired/server/server.pem",2949 keyfile="tests/certs/expired/server/server.key",2950 mutual_tls=True,2951 cacert="tests/certs/expired/ca/ca.crt",2952 )29532954 cert = (2955 "tests/certs/mtls/client/client.pem",2956 "tests/certs/mtls/client/client.key",2957 )2958 with server as (host, port):2959 url = f"https://{host}:{port}"2960 r1 = s.get(url, verify=False, cert=cert)2961 assert r1.status_code == 2002962 with pytest.raises(requests.exceptions.SSLError):2963 s.get(url, cert=cert)2964 close_server.set()29652966 assert client_cert is not None296729682969def test_json_decode_errors_are_serializable_deserializable():2970 json_decode_error = requests.exceptions.JSONDecodeError(2971 "Extra data",2972 '{"responseCode":["706"],"data":null}{"responseCode":["706"],"data":null}',2973 36,2974 )2975 deserialized_error = pickle.loads(pickle.dumps(json_decode_error))2976 assert repr(json_decode_error) == repr(deserialized_error)
modified:tests/test_utils.py+32 added
922 unmodified lines
923 with set_environ("test1", None):924 raise Exception("Expected exception")925926 assert "Expected exception" in str(exception.value)927928929@pytest.mark.skipif(os.name != "nt", reason="Test only on Windows")930def test_should_bypass_proxies_win_registry_ProxyOverride_value(monkeypatch):931 """Tests for function should_bypass_proxies to check if proxy932 can be bypassed or not with Windows ProxyOverride registry value ending with a semicolon.933 """934 import winreg935936 class RegHandle:937 def Close(self):938 pass939940 ie_settings = RegHandle()941942 def OpenKey(key, subkey):943 return ie_settings944945 def QueryValueEx(key, value_name):946 if key is ie_settings:947 if value_name == "ProxyEnable":948 return [1]949 elif value_name == "ProxyOverride":950 return [951 "192.168.*;127.0.0.1;localhost.localdomain;172.16.1.1;<-loopback>;"952 ]953954 monkeypatch.setenv("NO_PROXY", "")955 monkeypatch.setenv("no_proxy", "")956 monkeypatch.setattr(winreg, "OpenKey", OpenKey)957 monkeypatch.setattr(winreg, "QueryValueEx", QueryValueEx)958 assert should_bypass_proxies("http://example.com/", None) is False
added:.readthedocs.yaml+29 added
1# Read the Docs configuration file for Sphinx projects2# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details34# Required5version: 267# Set the OS, Python version and other tools you might need8build:9 os: ubuntu-22.0410 tools:11 python: "3.12"1213# Build documentation in the "docs/" directory with Sphinx14sphinx:15 configuration: docs/conf.py16 builder: "dirhtml"1718# Optionally build your docs in additional formats such as PDF and ePub19formats:20 - pdf21 - epub2223# Optional but recommended, declare the Python requirements required24# to build your documentation25# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html26python:27 install:28 - path: .29 - requirements: docs/requirements.txt
modified:AUTHORS.rst+2 added-1 removed
6 unmodified lines
7- Seth M. Larson `@sethmlarson <https://github.com/sethmlarson>`_.89Previous Keepers of Crystals10````````````````````````````11- Kenneth Reitz <me@kennethreitz.org> `@ken-reitz <https://github.com/ken-reitz>`_, reluctant Keeper of the Master Crystal.11- Kenneth Reitz <me@kennethreitz.org> `@kennethreitz <https://github.com/kennethreitz>`_, reluctant Keeper of the Master Crystal.12- Cory Benfield <cory@lukasa.co.uk> `@lukasa <https://github.com/lukasa>`_13- Ian Cordasco <graffatcolmingov@gmail.com> `@sigmavirus24 <https://github.com/sigmavirus24>`_.1415
175 unmodified lines
191- "Dull Bananas" <dull.bananas0@gmail.com> (`@dullbananas <https://github.com/dullbananas>`_)192- Alessio Izzo (`@aless10 <https://github.com/aless10>`_)193- Sylvain Marié (`@smarie <https://github.com/smarie>`_)194- Hod Bin Noon (`@hodbn <https://github.com/hodbn>`_)195- Mike Fiedler (`@miketheman <https://github.com/miketheman>`_)
modified:HISTORY.md+77 added-1 removed
4 unmodified lines
5---67- \[Short description of non-trivial change.\]892.32.3 (2024-05-29)10-------------------1112**Bugfixes**13- Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of14 HTTPAdapter. (#6716)15- Fixed issue where Requests started failing to run on Python versions compiled16 without the `ssl` module. (#6724)17182.32.2 (2024-05-21)19-------------------2021**Deprecations**22- To provide a more stable migration for custom HTTPAdapters impacted23 by the CVE changes in 2.32.0, we've renamed `_get_connection` to24 a new public API, `get_connection_with_tls_context`. Existing custom25 HTTPAdapters will need to migrate their code to use this new API.26 `get_connection` is considered deprecated in all versions of Requests>=2.32.0.2728 A minimal (2-line) example has been provided in the linked PR to ease29 migration, but we strongly urge users to evaluate if their custom adapter30 is subject to the same issue described in CVE-2024-35195. (#6710)31322.32.1 (2024-05-20)33-------------------3435**Bugfixes**36- Add missing test certs to the sdist distributed on PyPI.3738392.32.0 (2024-05-20)40-------------------4142**Security**43- Fixed an issue where setting `verify=False` on the first request from a44 Session will cause subsequent requests to the _same origin_ to also ignore45 cert verification, regardless of the value of `verify`.46 (https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56)4748**Improvements**49- `verify=True` now reuses a global SSLContext which should improve50 request time variance between first and subsequent requests. It should51 also minimize certificate load time on Windows systems when using a Python52 version built with OpenSSL 3.x. (#6667)53- Requests now supports optional use of character detection54 (`chardet` or `charset_normalizer`) when repackaged or vendored.55 This enables `pip` and other projects to minimize their vendoring56 surface area. The `Response.text()` and `apparent_encoding` APIs57 will default to `utf-8` if neither library is present. (#6702)5859**Bugfixes**60- Fixed bug in length detection where emoji length was incorrectly61 calculated in the request content-length. (#6589)62- Fixed deserialization bug in JSONDecodeError. (#6629)63- Fixed bug where an extra leading `/` (path separator) could lead64 urllib3 to unnecessarily reparse the request URI. (#6644)6566**Deprecations**6768- Requests has officially added support for CPython 3.12 (#6503)69- Requests has officially added support for PyPy 3.9 and 3.10 (#6641)70- Requests has officially dropped support for CPython 3.7 (#6642)71- Requests has officially dropped support for PyPy 3.7 and 3.8 (#6641)7273**Documentation**74- Various typo fixes and doc improvements.7576**Packaging**77- Requests has started adopting some modern packaging practices.78 The source files for the projects (formerly `requests`) is now located79 in `src/requests` in the Requests sdist. (#6506)80- Starting in Requests 2.33.0, Requests will migrate to a PEP 517 build system81 using `hatchling`. This should not impact the average user, but extremely old82 versions of packaging utilities may have issues with the new packaging format.8384852.31.0 (2023-05-22)86-------------------8788**Security**89- Versions of Requests between v2.3.0 and v2.30.0 are vulnerable to potential90 forwarding of `Proxy-Authorization` headers to destination servers when91 following HTTPS redirects.9217 When proxies are defined with user info (https://user:pass@proxy:8080), Requests93 When proxies are defined with user info (`https://user:pass@proxy:8080`), Requests94 will construct a `Proxy-Authorization` header that is attached to the request to95 authenticate with the proxy.9697 In cases where Requests receives a redirect response, it previously reattached
1885 unmodified lines
modified:MANIFEST.in+1 added
1include README.md LICENSE NOTICE HISTORY.md requirements-dev.txt2recursive-include tests *.py3recursive-include tests/certs *
modified:README.md+1 added-1 removed
31 unmodified lines
32```console33$ python -m pip install requests34```3536Requests officially supports Python 3.7+.36Requests officially supports Python 3.8+.3738## Supported Features & Best–Practices3940Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.
38 unmodified lines
modified:requirements-dev.txt+2 added-3 removed
1-e .[socks]2pytest>=2.8.0,<=6.2.52pytest>=2.8.0,<93pytest-cov4pytest-httpbin==2.0.05httpbin==0.10.05httpbin~=0.10.06trustme7wheel8cryptography<40.0.0; python_version <= '3.7' and platform_python_implementation == 'PyPy'
modified:setup.cfg+1 added-1 removed
5 unmodified lines
6requires-dist =7 certifi>=2017.4.178 charset_normalizer>=2,<49 idna>=2.5,<410 urllib3>=1.21.1,<1.2710 urllib3>=1.21.1,<31112[flake8]13ignore = E203, E501, W50314per-file-ignores =
3 unmodified lines
modified:setup.py+3 added-4 removed
5 unmodified lines
6from setuptools import setup7from setuptools.command.test import test as TestCommand89CURRENT_PYTHON = sys.version_info[:2]10REQUIRED_PYTHON = (3, 7)10REQUIRED_PYTHON = (3, 8)1112if CURRENT_PYTHON < REQUIRED_PYTHON:13 sys.stderr.write(14 """
4 unmodified lines
19you're trying to install it on Python {}.{}. To resolve this,20consider upgrading to a supported Python version.2122If you can't upgrade your Python version, you'll need to23pin to an older version of Requests (<2.28).23pin to an older version of Requests (<2.32.0).24""".format(25 *(REQUIRED_PYTHON + CURRENT_PYTHON)26 )27 )
65 unmodified lines
93 packages=["requests"],94 package_data={"": ["LICENSE", "NOTICE"]},95 package_dir={"": "src"},96 include_package_data=True,97 python_requires=">=3.7",97 python_requires=">=3.8",98 install_requires=requires,99 license=about["__license__"],100 zip_safe=False,101 classifiers=[
4 unmodified lines
106 "Natural Language :: English",107 "Operating System :: OS Independent",108 "Programming Language :: Python",109 "Programming Language :: Python :: 3",110 "Programming Language :: Python :: 3.7",110 "Programming Language :: Python :: 3.8",111 "Programming Language :: Python :: 3.9",112 "Programming Language :: Python :: 3.10",113 "Programming Language :: Python :: 3.11",
19 unmodified lines
modified:tox.ini+2 added-2 removed
1[tox]2envlist = py{37,38,39,310,311,312}-{default, use_chardet_on_py3}2envlist = py{38,39,310,311,312}-{default, use_chardet_on_py3}34[testenv]5deps = -rrequirements-dev.txt6extras =7 security8 socks9commands =10 pytest tests10 pytest {posargs:tests}1112[testenv:default]1314[testenv:use_chardet_on_py3]
4 unmodified lines