Open
Description
Occasionally it is useful to send HTTP204 via exception raise HTTPError(204)
.
Also when run with python -O
assertions are removed causing the check for no content useless.
But the response buffer has value:
[b'<html><title>204: No Content</title><body>204: No Content</body></html>']
Traceback (most recent call last):
File "/home/pgb/.local/lib/python3.10/site-packages/tornado/web.py", line 1791, in _execute
self._handle_request_exception(e)
File "/home/pgb/.local/lib/python3.10/site-packages/tornado/web.py", line 1846, in _handle_request_exception
self.send_error(e.status_code, exc_info=sys.exc_info())
File "/home/pgb/.local/lib/python3.10/site-packages/tornado/web.py", line 1298, in send_error
self.finish()
File "/home/pgb/.local/lib/python3.10/site-packages/tornado/web.py", line 1219, in finish
assert not self._write_buffer, (
AssertionError: Cannot send body with 204