https://github.com/python/cpython/commit/ab2aa4f70694bd7570ccd7253d89fcde570a7cac
commit: ab2aa4f70694bd7570ccd7253d89fcde570a7cac
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-09-05T15:58:32+01:00
summary:

[3.15] gh-89735: Document requirements for the *headers* argument (GH-155640) 
(#156898)

gh-89735: Document requirements for the *headers* argument (GH-155640)

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 6a2b274015c4be..bd317b96d2abc0 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -1056,6 +1056,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
@@ -1097,6 +1101,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]

Reply via email to