It seems Webapp2 does not support the status code 418
because it doesn't have a status message mapped to it. How do I get around it and return a 418
?
response.set_status(418) # does not work
response.status_int = 418 # does not work either
Traceback:
File "/.../App Engine SDK/lib/webapp2-2.5.2/webapp2.py", line 425, in set_status
self.status = code
File "/.../App Engine SDK/lib/webapp2-2.5.2/webapp2.py", line 405, in _set_status
message = message or Response.http_status_message(code)
File "/.../App Engine SDK/lib/webapp2-2.5.2/webapp2.py", line 488, in http_status_message
raise KeyError('Invalid HTTP status code: %d' % code)
KeyError: 'Invalid HTTP status code: 418'
418
when someone is trying to brew coffee with a teapot ;)statusreasons.py
in the App Engine SDK,418
is indeed missing.