From: ppaez Date: Mon, 12 May 2025 18:17:57 +0000 (-0600) Subject: gh-133413: Fix references to removed Request.has_data (GH-133414) X-Git-Tag: v3.15.0a1~1744 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86c1d439e0ccbe6baeda69322f1f8c0e6a80464c;p=thirdparty%2FPython%2Fcpython.git gh-133413: Fix references to removed Request.has_data (GH-133414) The has_data() method of http.request.Request was removed in version 3.4. --- diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 27c169dde727..091562cc9aef 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -2654,9 +2654,9 @@ with any methods on the mock: .. code-block:: pycon - >>> mock.has_data() + >>> mock.header_items() - >>> mock.has_data.assret_called_with() # Intentional typo! + >>> mock.header_items.assret_called_with() # Intentional typo! Auto-speccing solves this problem. You can either pass ``autospec=True`` to :func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function to create a diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index b0f26724d0c7..58bd111b5cc3 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1121,7 +1121,7 @@ HTTPHandler Objects .. method:: HTTPHandler.http_open(req) Send an HTTP request, which can be either GET or POST, depending on - ``req.has_data()``. + ``req.data``. .. _https-handler-objects: @@ -1133,7 +1133,7 @@ HTTPSHandler Objects .. method:: HTTPSHandler.https_open(req) Send an HTTPS request, which can be either GET or POST, depending on - ``req.has_data()``. + ``req.data``. .. _file-handler-objects: