]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-133413: Fix references to removed Request.has_data (GH-133414) (GH-133946)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 12 May 2025 18:25:25 +0000 (20:25 +0200)
committerGitHub <noreply@github.com>
Mon, 12 May 2025 18:25:25 +0000 (18:25 +0000)
The has_data() method of http.request.Request
was removed in version 3.4.
(cherry picked from commit 86c1d439e0ccbe6baeda69322f1f8c0e6a80464c)

Co-authored-by: ppaez <pp@pp.com.mx>
Doc/library/unittest.mock.rst
Doc/library/urllib.request.rst

index f6c616a353f5ab0df4c590d535fdf20d3e0c1a38..becfa34db6b9bb903808fa1ffcc8b9c6d1261dbd 100644 (file)
@@ -2653,9 +2653,9 @@ with any methods on the mock:
 
 .. code-block:: pycon
 
-    >>> mock.has_data()
+    >>> mock.header_items()
     <mock.Mock object at 0x...>
-    >>> 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
index 738455372237a8f2af6a2d5bf9e66413b0fc8a7a..b9673e38970560710ab27e5457417c6191a47466 100644 (file)
@@ -1076,7 +1076,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:
@@ -1088,7 +1088,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: