From ff8f445ef9fe8810f1e6fe95c2b71f7fb15594a4 Mon Sep 17 00:00:00 2001 From: David Cain Date: Wed, 27 Jul 2022 07:54:29 -0700 Subject: [PATCH] Remove Python 2 mention on `chardet` behavior `requests` no longer supports Python 2. A recent commit, 8bce583b9547c7b82d44c8e97f37cf9a16cbe758 removed the `chardet` dependency for Python 2: ```diff -'chardet>=3.0.2,<5; python_version < "3"', ``` We should edit the docs to remove mention of behavior on Py2. --- docs/user/advanced.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 2a91401a25..7decdb6029 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -717,10 +717,9 @@ If ``chardet`` is installed, ``requests`` uses it, however for python3 library is an LGPL-licenced dependency and some users of requests cannot depend on mandatory LGPL-licensed dependencies. -When you install ``request`` without specifying ``[use_chardet_on_py3]]`` extra, +When you install ``requests`` without specifying ``[use_chardet_on_py3]`` extra, and ``chardet`` is not already installed, ``requests`` uses ``charset-normalizer`` -(MIT-licensed) to guess the encoding. For Python 2, ``requests`` uses only -``chardet`` and is a mandatory dependency there. +(MIT-licensed) to guess the encoding. The only time Requests will not guess the encoding is if no explicit charset is present in the HTTP headers **and** the ``Content-Type``