Skip to content
Myr

Merge branch 'main' into spdx-conform-license

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

authored by Nate Prewitt · committed by GitHub · parents 53a0562, cb7fcd7 · Browse files · 22 files+242 added−125 removed
This commit

State

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

Diff stats

22 files+242 added−125 removed

  • tests:+60 added−5 removed
  • other:+182 added−120 removed

22 files+242 added−125 removed

modified:.github/workflows/codeql-analysis.yml+7 added
modified:.github/workflows/lint.yml+8 added-4 removed
modified:.github/workflows/run-tests.yml+7 added-5 removed
modified:docs/user/advanced.rst+27 added-1 removed
992 unmodified lines
993The mount call registers a specific instance of a Transport Adapter to a994prefix. Once mounted, any HTTP request made using that session whose URL starts995with the given prefix will use the given Transport Adapter.996997.. note:: The adapter will be chosen based on a longest prefix match. Be mindful998 prefixes such as ``http://localhost`` will also match ``http://localhost.other.com``999 or ``http://localhost@other.com``. It's recommended to terminate full hostnames with a ``/``.10001001Many of the details of implementing a Transport Adapter are beyond the scope of1002this documentation, but take a look at the next example for a simple SSL use-1003case. For more than that, you might look at subclassing the1004:class:`BaseAdapter <requests.adapters.BaseAdapter>`.
24 unmodified lines
1029 self.poolmanager = PoolManager(1030 num_pools=connections, maxsize=maxsize,1031 block=block, ssl_version=ssl.PROTOCOL_SSLv3)10321033Example: Automatic Retries1034^^^^^^^^^^^^^^^^^^^^^^^^^^10351036By default, Requests does not retry failed connections. However, it is possible1037to implement automatic retries with a powerful array of features, including1038backoff, within a Requests :class:`Session <requests.Session>` using the1039`urllib3.util.Retry`_ class::10401041 from urllib3.util import Retry1042 from requests import Session1043 from requests.adapters import HTTPAdapter10441045 s = Session()1046 retries = Retry(1047 total=3,1048 backoff_factor=0.1,1049 status_forcelist=[502, 503, 504],1050 allowed_methods={'POST'},1051 )1052 s.mount('https://', HTTPAdapter(max_retries=retries))10531054.. _`described here`: https://kenreitz.org/essays/2012/06/14/the-future-of-python-http1055.. _`urllib3`: https://github.com/urllib3/urllib31056.. _`urllib3.util.Retry`: https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Retry10571058.. _blocking-or-nonblocking:10591060Blocking Or Non-Blocking?
19 unmodified lines
1080---------------10811082In unusual circumstances you may want to provide headers in an ordered manner. If you pass an ``OrderedDict`` to the ``headers`` keyword argument, that will provide the headers with an ordering. *However*, the ordering of the default headers used by Requests will be preferred, which means that if you override default headers in the ``headers`` keyword argument, they may appear out of order compared to other headers in that keyword argument.10831058If this is problematic, users should consider setting the default headers on a :class:`Session <requests.Session>` object, by setting :attr:`Session <requests.Session.headers>` to a custom ``OrderedDict``. That ordering will always be preferred.1084If this is problematic, users should consider setting the default headers on a :class:`Session <requests.Session>` object, by setting :attr:`Session.headers <requests.Session.headers>` to a custom ``OrderedDict``. That ordering will always be preferred.10851086.. _timeouts:10871088Timeouts
37 unmodified lines
modified:docs/user/install.rst+1 added-1 removed
20 unmodified lines
21`always available <https://github.com/psf/requests>`_.2223You can either clone the public repository::2425 $ git clone git://github.com/psf/requests.git25 $ git clone https://github.com/psf/requests.git2627Or, download the `tarball <https://github.com/psf/requests/tarball/main>`_::2829 $ curl -OL https://github.com/psf/requests/tarball/main
7 unmodified lines
modified:docs/user/quickstart.rst+2 added-2 removed
175 unmodified lines
176 >>> r.raw177 <urllib3.response.HTTPResponse object at 0x101194810>178179 >>> r.raw.read(10)180 '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'180 b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03'181182In general, however, you should use a pattern like this to save what is being183streamed to a file::184
51 unmodified lines
236dictionary of data will automatically be form-encoded when the request is made::237238 >>> payload = {'key1': 'value1', 'key2': 'value2'}239240 >>> r = requests.post("https://httpbin.org/post", data=payload)240 >>> r = requests.post('https://httpbin.org/post', data=payload)241 >>> print(r.text)242 {243 ...244 "form": {
327 unmodified lines
modified:requests/__init__.py+4 added-4 removed
64 unmodified lines
6566 # Check urllib3 for compatibility.67 major, minor, patch = urllib3_version # noqa: F81168 major, minor, patch = int(major), int(minor), int(patch)69 # urllib3 >= 1.21.1, <= 1.2670 assert major == 171 assert minor >= 2172 assert minor <= 2669 # urllib3 >= 1.21.170 assert major >= 171 if major == 1:72 assert minor >= 217374 # Check charset_normalizer for compatibility.75 if chardet_version:76 major, minor, patch = chardet_version.split(".")[:3]
104 unmodified lines
modified:requests/__version__.py+3 added-3 removed
3 unmodified lines
45__title__ = "requests"6__description__ = "Python HTTP for Humans."7__url__ = "https://requests.readthedocs.io"8__version__ = "2.28.1"9__build__ = 0x0228018__version__ = "2.31.0"9__build__ = 0x02310010__author__ = "Kenneth Reitz"11__author_email__ = "me@kennethreitz.org"12__license__ = "Apache-2.0"13__copyright__ = "Copyright 2022 Kenneth Reitz"13__copyright__ = "Copyright Kenneth Reitz"14__cake__ = "\u2728 \U0001f370 \u2728"
modified:requests/_internal_utils.py+4 added-2 removed
12 unmodified lines
13_VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*$")14_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*$|^$")15_VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*$|^$")1617_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR)18_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE)19HEADER_VALIDATORS = {18 bytes: (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE),19 str: (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR),20 bytes: _HEADER_VALIDATORS_BYTE,21 str: _HEADER_VALIDATORS_STR,22}232425def to_native_string(string, encoding="ascii"):
25 unmodified lines
modified:requests/adapters.py+13 added-59 removed
20 unmodified lines
21from urllib3.exceptions import ProxyError as _ProxyError22from urllib3.exceptions import ReadTimeoutError, ResponseError23from urllib3.exceptions import SSLError as _SSLError24from urllib3.poolmanager import PoolManager, proxy_from_url25from urllib3.response import HTTPResponse25from urllib3.util import Timeout as TimeoutSauce26from urllib3.util import parse_url27from urllib3.util.retry import Retry28
163 unmodified lines
192 self.poolmanager = PoolManager(193 num_pools=connections,194 maxsize=maxsize,195 block=block,197 strict=True,196 **pool_kwargs,197 )198199 def proxy_manager_for(self, proxy, **proxy_kwargs):
282 unmodified lines
482 else:483 timeout = TimeoutSauce(connect=timeout, read=timeout)484485 try:488 if not chunked:489 resp = conn.urlopen(490 method=request.method,491 url=url,492 body=request.body,493 headers=request.headers,494 redirect=False,495 assert_same_host=False,496 preload_content=False,497 decode_content=False,498 retries=self.max_retries,499 timeout=timeout,500 )486 resp = conn.urlopen(487 method=request.method,488 url=url,489 body=request.body,490 headers=request.headers,491 redirect=False,492 assert_same_host=False,493 preload_content=False,494 decode_content=False,495 retries=self.max_retries,496 timeout=timeout,497 chunked=chunked,498 )499502 # Send the request.503 else:504 if hasattr(conn, "proxy_pool"):505 conn = conn.proxy_pool506507 low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT)508509 try:510 skip_host = "Host" in request.headers511 low_conn.putrequest(512 request.method,513 url,514 skip_accept_encoding=True,515 skip_host=skip_host,516 )517518 for header, value in request.headers.items():519 low_conn.putheader(header, value)520521 low_conn.endheaders()522523 for i in request.body:524 low_conn.send(hex(len(i))[2:].encode("utf-8"))525 low_conn.send(b"\r\n")526 low_conn.send(i)527 low_conn.send(b"\r\n")528 low_conn.send(b"0\r\n\r\n")529530 # Receive the response from the server531 r = low_conn.getresponse()532533 resp = HTTPResponse.from_httplib(534 r,535 pool=conn,536 connection=low_conn,537 preload_content=False,538 decode_content=False,539 )540 except Exception:541 # If we hit any problems here, clean up the connection.542 # Then, raise so that we can handle the actual exception.543 low_conn.close()544 raise545500 except (ProtocolError, OSError) as err:501 raise ConnectionError(err, request=request)502503 except MaxRetryError as e:
35 unmodified lines
modified:requests/api.py+4 added-4 removed
23 unmodified lines
24 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.25 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.26 :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.27 ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``28 or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string28 or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content_type'`` is a string29 defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers30 to add for the file.31 :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.32 :param timeout: (optional) How many seconds to wait for the server to send data
72 unmodified lines
105106 :param url: URL for the new :class:`Request` object.107 :param data: (optional) Dictionary, list of tuples, bytes, or file-like108 object to send in the body of the :class:`Request`.109 :param json: (optional) json data to send in the body of the :class:`Request`.109 :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.110 :param \*\*kwargs: Optional arguments that ``request`` takes.111 :return: :class:`Response <Response>` object112 :rtype: requests.Response113 """
6 unmodified lines
120121 :param url: URL for the new :class:`Request` object.122 :param data: (optional) Dictionary, list of tuples, bytes, or file-like123 object to send in the body of the :class:`Request`.124 :param json: (optional) json data to send in the body of the :class:`Request`.124 :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.125 :param \*\*kwargs: Optional arguments that ``request`` takes.126 :return: :class:`Response <Response>` object127 :rtype: requests.Response128 """
6 unmodified lines
135136 :param url: URL for the new :class:`Request` object.137 :param data: (optional) Dictionary, list of tuples, bytes, or file-like138 object to send in the body of the :class:`Request`.139 :param json: (optional) json data to send in the body of the :class:`Request`.139 :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.140 :param \*\*kwargs: Optional arguments that ``request`` takes.141 :return: :class:`Response <Response>` object142 :rtype: requests.Response143 """
14 unmodified lines
modified:requests/cookies.py+8 added-8 removed
1"""2requests.cookies3~~~~~~~~~~~~~~~~45Compatibility code to be able to use `cookielib.CookieJar` with requests.5Compatibility code to be able to use `http.cookiejar.CookieJar` with requests.67requests.utils imports from here, so be careful with imports.8"""9
12 unmodified lines
2223class MockRequest:24 """Wraps a `requests.Request` to mimic a `urllib2.Request`.2526 The code in `cookielib.CookieJar` expects this interface in order to correctly26 The code in `http.cookiejar.CookieJar` expects this interface in order to correctly27 manage cookie policies, i.e., determine whether a cookie can be set, given the28 domains of the request and the cookie.2930 The original request object is read-only. The client is responsible for collecting
44 unmodified lines
75 def get_header(self, name, default=None):76 return self._r.headers.get(name, self._new_headers.get(name, default))7778 def add_header(self, key, val):79 """cookielib has no legitimate use for this method; add it back if you find one."""79 """cookiejar has no legitimate use for this method; add it back if you find one."""80 raise NotImplementedError(81 "Cookie headers should be added with add_unredirected_header()"82 )83
19 unmodified lines
103class MockResponse:104 """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.105106 ...what? Basically, expose the parsed HTTP headers from the server response107 the way `cookielib` expects to see them.107 the way `http.cookiejar` expects to see them.108 """109110 def __init__(self, headers):111 """Make a MockResponse for `cookielib` to read.111 """Make a MockResponse for `cookiejar` to read.112113 :param headers: a httplib.HTTPMessage or analogous carrying the headers114 """115 self._headers = headers
7 unmodified lines
123124def extract_cookies_to_jar(jar, request, response):125 """Extract the cookies from the response into a CookieJar.126127 :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar)127 :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)128 :param request: our own requests.Request object129 :param response: urllib3.HTTPResponse object130 """131 if not (hasattr(response, "_original_response") and response._original_response):
41 unmodified lines
173 """174175176class RequestsCookieJar(cookielib.CookieJar, MutableMapping):177 """Compatibility class; is a cookielib.CookieJar, but exposes a dict177 """Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict178 interface.179180 This is the CookieJar we create by default for requests and sessions that181 don't specify one, since some clients may expect response.cookies and
158 unmodified lines
340 """341 self.set(name, value)342343 def __delitem__(self, name):344 """Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s344 """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s345 ``remove_cookie_by_name()``.346 """347 remove_cookie_by_name(self, name)348
213 unmodified lines
modified:requests/sessions.py+5 added-1 removed
322 unmodified lines
323 username, password = get_auth_from_url(new_proxies[scheme])324 except KeyError:325 username, password = None, None326327 if username and password:327 # urllib3 handles proxy authorization for us in the standard adapter.328 # Avoid appending this to TLS tunneled requests where it may be leaked.329 if not scheme.startswith("https") and username and password:330 headers["Proxy-Authorization"] = _basic_auth_str(username, password)331332 return new_proxies333
210 unmodified lines
544 :param allow_redirects: (optional) Set to True by default.545 :type allow_redirects: bool546 :param proxies: (optional) Dictionary mapping protocol or protocol and547 hostname to the URL of the proxy.548 :param hooks: (optional) Dictionary mapping hook name to one event or549 list of events, event must be callable.550 :param stream: (optional) whether to immediately download the response551 content. Defaults to ``False``.552 :param verify: (optional) Either a boolean, in which case it controls whether we verify553 the server's TLS certificate, or a string, in which case it must be a path
282 unmodified lines
modified:requests/utils.py+20 added-16 removed
23 unmodified lines
24from . import certs25from .__version__ import __version__2627# to_native_string is unused here, but imported here for backwards compatibility28from ._internal_utils import HEADER_VALIDATORS, to_native_string # noqa: F40128from ._internal_utils import ( # noqa: F40129 _HEADER_VALIDATORS_BYTE,30 _HEADER_VALIDATORS_STR,31 HEADER_VALIDATORS,32 to_native_string,33)34from .compat import (35 Mapping,36 basestring,37 bytes,
427 unmodified lines
465 :param cj: CookieJar object to extract cookies from.466 :rtype: dict467 """468464 cookie_dict = {}465466 for cookie in cj:467 cookie_dict[cookie.name] = cookie.value468469 cookie_dict = {cookie.name: cookie.value for cookie in cj}470 return cookie_dict471472473def add_dict_to_cookiejar(cj, cookie_dict):
557 unmodified lines
10311032 :param header: tuple, in the format (name, value).1033 """1034 name, value = header1035 _validate_header_part(header, name, 0)1036 _validate_header_part(header, value, 1)10371035 for part in header:1036 if type(part) not in HEADER_VALIDATORS:1037 raise InvalidHeader(1038 f"Header part ({part!r}) from {{{name!r}: {value!r}}} must be "1039 f"of type str or bytes, not {type(part)}"1040 )10381042 _validate_header_part(name, "name", HEADER_VALIDATORS[type(name)][0])1043 _validate_header_part(value, "value", HEADER_VALIDATORS[type(value)][1])1039def _validate_header_part(header, header_part, header_validator_index):1040 if isinstance(header_part, str):1041 validator = _HEADER_VALIDATORS_STR[header_validator_index]1042 elif isinstance(header_part, bytes):1043 validator = _HEADER_VALIDATORS_BYTE[header_validator_index]1044 else:1045 raise InvalidHeader(1046 f"Header part ({header_part!r}) from {header} "1047 f"must be of type str or bytes, not {type(header_part)}"1048 )104910451046def _validate_header_part(header_part, header_kind, validator):1050 if not validator.match(header_part):1051 header_kind = "name" if header_validator_index == 0 else "value"1052 raise InvalidHeader(1053 f"Invalid leading whitespace, reserved character(s), or return"1054 f"character(s) in header {header_kind}: {header_part!r}"1055 )
35 unmodified lines
modified:tests/__init__.py+9 added-5 removed
1"""Requests test package initialisation."""23import warnings45try:5from urllib3.exceptions import SNIMissingWarning6 from urllib3.exceptions import SNIMissingWarning77# urllib3 sets SNIMissingWarning to only go off once,8# while this test suite requires it to always fire9# so that it occurs during test_requests.test_https_warnings10warnings.simplefilter("always", SNIMissingWarning)8 # urllib3 1.x sets SNIMissingWarning to only go off once,9 # while this test suite requires it to always fire10 # so that it occurs during test_requests.test_https_warnings11 warnings.simplefilter("always", SNIMissingWarning)12except ImportError:13 # urllib3 2.0 removed that warning and errors out instead14 SNIMissingWarning = None
modified:tests/test_requests.py+51 added
46 unmodified lines
47from requests.models import PreparedRequest, urlencode48from requests.sessions import SessionRedirectMixin49from requests.structures import CaseInsensitiveDict5051from . import SNIMissingWarning52from .compat import StringIO53from .utils import override_environ5455# Requests to this URL should always fail with a connection timeout (nothing
590 unmodified lines
646 sent_headers = resp.json().get("headers", {})647648 assert sent_headers.get("Proxy-Authorization") == proxy_auth_value649650 @pytest.mark.parametrize(651 "url,has_proxy_auth",652 (653 ("http://example.com", True),654 ("https://example.com", False),655 ),656 )657 def test_proxy_authorization_not_appended_to_https_request(658 self, url, has_proxy_auth659 ):660 session = requests.Session()661 proxies = {662 "http": "http://test:pass@localhost:8080",663 "https": "http://test:pass@localhost:8090",664 }665 req = requests.Request("GET", url)666 prep = req.prepare()667 session.rebuild_proxies(prep, proxies)668669 assert ("Proxy-Authorization" in prep.headers) is has_proxy_auth670671 def test_basicauth_with_netrc(self, httpbin):672 auth = ("user", "pass")673 wrong_auth = ("wronguser", "wrongpass")674 url = httpbin("basic-auth", "user", "pass")
320 unmodified lines
995 def test_http_with_certificate(self, httpbin):996 r = requests.get(httpbin(), cert=".")997 assert r.status_code == 200998999 @pytest.mark.skipif(1000 SNIMissingWarning is None,1001 reason="urllib3 2.0 removed that warning and errors out instead",1002 )1003 def test_https_warnings(self, nosan_server):1004 """warnings are emitted with requests.get"""1005 host, port, ca_bundle = nosan_server1006 if HAS_MODERN_SSL or HAS_PYOPENSSL:
765 unmodified lines
1772 """1773 with pytest.raises(InvalidHeader):1774 requests.get(httpbin("get"), headers=invalid_header)17751776 def test_header_with_subclass_types(self, httpbin):1777 """If the subclasses does not behave *exactly* like1778 the base bytes/str classes, this is not supported.1779 This test is for backwards compatibility.1780 """17811782 class MyString(str):1783 pass17841785 class MyBytes(bytes):1786 pass17871788 r_str = requests.get(httpbin("get"), headers={MyString("x-custom"): "myheader"})1789 assert r_str.request.headers["x-custom"] == "myheader"17901791 r_bytes = requests.get(1792 httpbin("get"), headers={MyBytes(b"x-custom"): b"myheader"}1793 )1794 assert r_bytes.request.headers["x-custom"] == b"myheader"17951796 r_mixed = requests.get(1797 httpbin("get"), headers={MyString("x-custom"): MyBytes(b"myheader")}1798 )1799 assert r_mixed.request.headers["x-custom"] == b"myheader"18001801 @pytest.mark.parametrize("files", ("foo", b"foo", bytearray(b"foo")))1802 def test_can_send_objects_with_files(self, httpbin, files):1803 data = {"a": "this is a string"}1804 files = {"b": files}
1007 unmodified lines
modified:.pre-commit-config.yaml+3 added-3 removed
7 unmodified lines
8 - id: debug-statements9 - id: end-of-file-fixer10 - id: trailing-whitespace11- repo: https://github.com/PyCQA/isort12 rev: 5.10.112 rev: 5.12.013 hooks:14 - id: isort15- repo: https://github.com/psf/black16 rev: 22.3.0
4 unmodified lines
21 rev: v2.31.122 hooks:23 - id: pyupgrade24 args: [--py37-plus]25- repo: https://gitlab.com/pycqa/flake826 rev: 4.0.125- repo: https://github.com/PyCQA/flake826 rev: 6.0.027 hooks:28 - id: flake8
modified:HISTORY.md+59 added-1 removed
4 unmodified lines
5---67- \[Short description of non-trivial change.\]892.31.0 (2023-05-22)10-------------------1112**Security**13- Versions of Requests between v2.3.0 and v2.30.0 are vulnerable to potential14 forwarding of `Proxy-Authorization` headers to destination servers when15 following HTTPS redirects.1617 When proxies are defined with user info (https://user:pass@proxy:8080), Requests18 will construct a `Proxy-Authorization` header that is attached to the request to19 authenticate with the proxy.2021 In cases where Requests receives a redirect response, it previously reattached22 the `Proxy-Authorization` header incorrectly, resulting in the value being23 sent through the tunneled connection to the destination server. Users who rely on24 defining their proxy credentials in the URL are *strongly* encouraged to upgrade25 to Requests 2.31.0+ to prevent unintentional leakage and rotate their proxy26 credentials once the change has been fully deployed.2728 Users who do not use a proxy or do not supply their proxy credentials through29 the user information portion of their proxy URL are not subject to this30 vulnerability.3132 Full details can be read in our [Github Security Advisory](https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q)33 and [CVE-2023-32681](https://nvd.nist.gov/vuln/detail/CVE-2023-32681).3435362.30.0 (2023-05-03)37-------------------3839**Dependencies**40- ⚠️ Added support for urllib3 2.0. ⚠️4142 This may contain minor breaking changes so we advise careful testing and43 reviewing https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html44 prior to upgrading.4546 Users who wish to stay on urllib3 1.x can pin to `urllib3<2`.47482.29.0 (2023-04-26)49-------------------5051**Improvements**5253- Requests now defers chunked requests to the urllib3 implementation to improve54 standardization. (#6226)55- Requests relaxes header component requirements to support bytes/str subclasses. (#6356)56572.28.2 (2023-01-12)58-------------------5960**Dependencies**6162- Requests now supports charset\_normalizer 3.x. (#6261)6364**Bugfixes**6566- Updated MissingSchema exception to suggest https scheme rather than http. (#6188)67682.28.1 (2022-06-29)69-------------------7071**Improvements**
27 unmodified lines
99- Fixed bug where setting `CURL_CA_BUNDLE` to an empty string would disable100 cert verification. All Requests 2.x versions before 2.28.0 are affected. (#6074)101- Fixed urllib3 exception leak, wrapping `urllib3.exceptions.SSLError` with102 `requests.exceptions.SSLError` for `content` and `iter_content`. (#6057)45- Fixed issue where invalid Windows registry entires caused proxy resolution103- Fixed issue where invalid Windows registry entries caused proxy resolution104 to raise an exception rather than ignoring the entry. (#6149)105- Fixed issue where entire payload could be included in the error message for106 JSONDecodeError. (#6036)107
1799 unmodified lines
modified:pyproject.toml+1 added-1 removed
2 unmodified lines
3src_paths = ["requests", "test"]4honor_noqa = true56[tool.pytest.ini_options]7addopts = "-p no:warnings --doctest-modules"7addopts = "--doctest-modules"8doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"9minversion = "6.2"10testpaths = [11 "requests",
2 unmodified lines
modified:requirements-dev.txt+2 added-1 removed
1-e .[socks]2pytest>=2.8.0,<=6.2.53pytest-cov4pytest-httpbin==1.0.04pytest-httpbin==2.0.05pytest-mock==2.0.06httpbin==0.7.07trustme8wheel9cryptography<40.0.0; python_version <= '3.7' and platform_python_implementation == 'PyPy'1011# Flask Stack12Flask>1.0,<2.013markupsafe<2.1
modified:setup.py+3 added-3 removed
59 unmodified lines
6061requires = [62 "charset_normalizer>=2,<4",63 "idna>=2.5,<4",64 "urllib3>=1.21.1,<1.27",64 "urllib3>=1.21.1,<3",65 "certifi>=2017.4.17",66]67test_requirements = [68 "pytest-httpbin==0.0.7",68 "pytest-httpbin==2.0.0",69 "pytest-cov",70 "pytest-mock",71 "pytest-xdist",72 "PySocks>=1.5.6, !=1.5.7",
20 unmodified lines
93 packages=["requests"],94 package_data={"": ["LICENSE", "NOTICE"]},95 package_dir={"requests": "requests"},96 include_package_data=True,97 python_requires=">=3.7, <4",97 python_requires=">=3.7",98 install_requires=requires,99 license=about["__license__"],100 zip_safe=False,101 classifiers=[
31 unmodified lines
modified:tox.ini+1 added-1 removed
1[tox]2envlist = py{37,38,39,310}-{default, use_chardet_on_py3}2envlist = py{37,38,39,310,311}-{default, use_chardet_on_py3}34[testenv]5deps = -rrequirements-dev.txt6extras =
12 unmodified lines