Kaydet (Commit) 09a7df83 authored tarafından Georg Brandl's avatar Georg Brandl

#3243 follow-up: remove debugging print and fix docs; data is a bytes object.

üst 7bc0d872
...@@ -403,7 +403,7 @@ HTTPConnection Objects ...@@ -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: ...@@ -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): ...@@ -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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment