Skip to content

[3.14] gh-133413: Fix references to removed Request.has_data (GH-133414) #133945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
(cherry picked from commit 86c1d43)

Co-authored-by: ppaez <pp@pp.com.mx>
  • Loading branch information
ppaez authored and miss-islington committed May 12, 2025
commit 2c9fccb187b97a2bc17f1df6772ebc4d8b4e2408
4 changes: 2 additions & 2 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2654,9 +2654,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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/urllib.request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Loading