https://github.com/python/cpython/commit/1414d2ac6f8a57ce5e0c8d3ab1fdc7075fd2d1ea
commit: 1414d2ac6f8a57ce5e0c8d3ab1fdc7075fd2d1ea
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-09-03T18:48:32+03:00
summary:

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.

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 9274a0c88ac4c8..7a0ccfd024beb3 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