https://github.com/python/cpython/commit/a8a1871942ef35c68a186d0592de51b7b934ee65 commit: a8a1871942ef35c68a186d0592de51b7b934ee65 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-09-03T15:58:51Z summary:
[3.14] gh-89735: Document requirements for the *headers* argument (GH-155640) (GH-156899) Both handlers look up the header name in lowercase, and the basic one needs get_all(), so a plain dict does not work. (cherry picked from commit 1414d2ac6f8a57ce5e0c8d3ab1fdc7075fd2d1ea) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> files: M Doc/library/urllib.request.rst diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index cfc99804d5cf4d..f1308dd568fd0c 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1060,6 +1060,10 @@ AbstractBasicAuthHandler Objects authenticate for, *req* should be the (failed) :class:`Request` object, and *headers* should be the error headers. + *headers* must be a mapping-like object with case-insensitive lookup + that implements the ``get_all()`` method, + such as :class:`email.message.Message` or :class:`wsgiref.headers.Headers`. + *host* is either an authority (e.g. ``"python.org"``) or a URL containing an authority component (e.g. ``"https://python.org/"``). In either case, the authority must not contain a userinfo component (so, ``"python.org"`` and @@ -1101,6 +1105,9 @@ AbstractDigestAuthHandler Objects should be the (failed) :class:`Request` object, and *headers* should be the error headers. + *headers* must be a mapping-like object with case-insensitive lookup, + such as :class:`email.message.Message` or :class:`wsgiref.headers.Headers`. + .. _http-digest-auth-handler: _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
