#3243 follow-up: remove debugging print and fix docs; data is a bytes object.
This commit is contained in:
parent
7bc0d872dd
commit
09a7df8301
@ -403,7 +403,7 @@ HTTPConnection Objects
|
|||||||
headers to send with the request.
|
headers to send with the request.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
*body* can be an iterable
|
*body* can now be an iterable.
|
||||||
|
|
||||||
.. method:: HTTPConnection.getresponse()
|
.. method:: HTTPConnection.getresponse()
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ The :mod:`urllib.request` module defines the following functions:
|
|||||||
Open the URL *url*, which can be either a string or a
|
Open the URL *url*, which can be either a string or a
|
||||||
:class:`Request` object.
|
:class:`Request` object.
|
||||||
|
|
||||||
*data* may be a string specifying additional data to send to the
|
*data* may be a bytes object specifying additional data to send to the
|
||||||
server, or ``None`` if no such data is needed. *data* may also be an
|
server, or ``None`` if no such data is needed. *data* may also be an
|
||||||
iterable object and in that case Content-Length value must be specified in
|
iterable object and in that case Content-Length value must be specified in
|
||||||
the headers. Currently HTTP requests are the only ones that use *data*; the
|
the headers. Currently HTTP requests are the only ones that use *data*; the
|
||||||
|
@ -1057,7 +1057,6 @@ class AbstractHTTPHandler(BaseHandler):
|
|||||||
try:
|
try:
|
||||||
mv = memoryview(data)
|
mv = memoryview(data)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
print(data)
|
|
||||||
if isinstance(data, collections.Iterable):
|
if isinstance(data, collections.Iterable):
|
||||||
raise ValueError("Content-Length should be specified \
|
raise ValueError("Content-Length should be specified \
|
||||||
for iterable data of type %r %r" % (type(data),
|
for iterable data of type %r %r" % (type(data),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user