Skip to content

Commit 0fc73e5

Browse files
committed
urllib.request.HTTPRedirectHandler documentation uses hdrs instead of headers #135468
1 parent 03017a8 commit 0fc73e5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Doc/library/urllib.request.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,11 +911,17 @@ HTTPRedirectHandler Objects
911911
do allow automatic redirection of these responses, changing the POST to a
912912
``GET``, and the default implementation reproduces this behavior.
913913

914-
915914
.. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs)
916915

917916
Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the
918-
parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response.
917+
parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response.
918+
:class:`OpenerDirector` will call this method with five positional arguments:
919+
920+
* a :class:`Request` object,
921+
* a file-like object with the HTTP error body,
922+
* the three-digit code of the error, as a string,
923+
* the user-visible explanation of the code, as as string, and
924+
* the headers of the error, as a mapping object.
919925

920926

921927
.. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs)

0 commit comments

Comments
 (0)