From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 22 Jul 2025 08:29:59 +0000 (+0200) Subject: [3.13] gh-135468: Improve ``BaseHandler.http_error_default()`` parameter descriptions... X-Git-Tag: v3.13.6~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4b991aef18f07750f2b46bc41c8b1a5a596c76c;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-135468: Improve ``BaseHandler.http_error_default()`` parameter descriptions (GH-136797) (#136826) Co-authored-by: Valerio Gianella <49408327+valeriogianella@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> --- diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index b9673e389705..c42a1fe37c51 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -784,10 +784,13 @@ The following attribute and methods should only be used by classes derived from errors. It will be called automatically by the :class:`OpenerDirector` getting the error, and should not normally be called in other circumstances. - *req* will be a :class:`Request` object, *fp* will be a file-like object with - the HTTP error body, *code* will be the three-digit code of the error, *msg* - will be the user-visible explanation of the code and *hdrs* will be a mapping - object with the headers of the error. + :class:`OpenerDirector` will call this method with five positional arguments: + + 1. a :class:`Request` object, + #. a file-like object with the HTTP error body, + #. the three-digit code of the error, as a string, + #. the user-visible explanation of the code, as as string, and + #. the headers of the error, as a mapping object. Return values and exceptions raised should be the same as those of :func:`urlopen`.