]> git.ipfire.org Git - thirdparty/tornado.git/commit
httpclient: HTTPResponse.body returns empty string instead of raising 2629/head
authorBen Darnell <ben@bendarnell.com>
Sat, 23 Mar 2019 15:11:18 +0000 (11:11 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 23 Mar 2019 15:11:18 +0000 (11:11 -0400)
commit62f3cddec4d6d01b3bd94f9b5ebfbc0c030d3619
treea7784f724dc083c0a68382758f724080a4e0abbd
parent1772d6101d52935f9624bd56b8d4ce9fcfecc4e9
httpclient: HTTPResponse.body returns empty string instead of raising

In tornado 5, HTTPResponse.body would return None if there was no body
buffer (which included errors like timeouts and socket errors, but not
HTTP errors like 404). In tornado 6 this was changed to never return
None (to make it easier to work with type annotations) and raise an
error instead. This turned out to be disruptive, so change it back to
returning a value without raising (but now it's an empty byte string
instead of None).

Fixes #2626
tornado/httpclient.py