From e5ac7b0ddacb98383f51ae06aa47ad0ad5db755e Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Sat, 22 Jan 2022 19:17:20 -0500 Subject: [PATCH 1/2] documented *headers* param for http_error_auth_reqed() --- Doc/library/urllib.request.rst | 5 +++++ .../next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 88e93ba6b002eb2..f1648d94ee63008 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -998,6 +998,11 @@ AbstractBasicAuthHandler Objects authority must not contain a userinfo component (so, ``"python.org"`` and ``"python.org:80"`` are fine, ``"joe:password@python.org"`` is not). + Headers object can be created as follows: + + import email + headers = email.message.Message() + headers['Content-type'] = 'text/plain' .. _http-basic-auth-handler: diff --git a/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst b/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst new file mode 100644 index 000000000000000..b933e9254ffd8f7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst @@ -0,0 +1,2 @@ +Documented *headers* parameter for +:func:`urllib.request.http_error_auth_reqed`. From 8e427f7f76511c95cafbc00bb3012a8085f0b70d Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Wed, 12 Oct 2022 22:46:31 -0400 Subject: [PATCH 2/2] Update Doc/library/urllib.request.rst Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> --- Doc/library/urllib.request.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index f1648d94ee63008..77cb33cf5e984a0 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -998,11 +998,11 @@ AbstractBasicAuthHandler Objects authority must not contain a userinfo component (so, ``"python.org"`` and ``"python.org:80"`` are fine, ``"joe:password@python.org"`` is not). - Headers object can be created as follows: + Headers object can be created as follows:: - import email - headers = email.message.Message() - headers['Content-type'] = 'text/plain' + import email + headers = email.message.Message() + headers['Content-type'] = 'text/plain' .. _http-basic-auth-handler: