Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09a7df8

Browse files
committed
#3243 follow-up: remove debugging print and fix docs; data is a bytes object.
1 parent 7bc0d87 commit 09a7df8

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

Doc/library/http.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ HTTPConnection Objects
403403
headers to send with the request.
404404

405405
.. versionadded:: 3.2
406-
*body* can be an iterable
406+
*body* can now be an iterable.
407407

408408
.. method:: HTTPConnection.getresponse()
409409

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The :mod:`urllib.request` module defines the following functions:
2020
Open the URL *url*, which can be either a string or a
2121
:class:`Request` object.
2222

23-
*data* may be a string specifying additional data to send to the
23+
*data* may be a bytes object specifying additional data to send to the
2424
server, or ``None`` if no such data is needed. *data* may also be an
2525
iterable object and in that case Content-Length value must be specified in
2626
the headers. Currently HTTP requests are the only ones that use *data*; the

Lib/urllib/request.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,6 @@ def do_request_(self, request):
10571057
try:
10581058
mv = memoryview(data)
10591059
except TypeError:
1060-
print(data)
10611060
if isinstance(data, collections.Iterable):
10621061
raise ValueError("Content-Length should be specified \
10631062
for iterable data of type %r %r" % (type(data),

0 commit comments

Comments
 (0)