Executed the file under python3, on Raspbian Debian 9 Stretch. Get the following...
500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 628, in respond
File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 687, in _do_respond
response.body = self.handler()
File "/usr/local/lib/python3.5/dist-packages/cherrypy/lib/encoding.py", line 219, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
File "REST.py", line 11, in GET
File "/usr/local/lib/python3.5/dist-packages/cherrypy/__init__.py", line 246, in __getitem__
File "/usr/local/lib/python3.5/dist-packages/cherrypy/lib/sessions.py", line 325, in __getitem__
[hidden email] wrote:
> CherryPy Tutorial 7 - Give it a REST? Fails? Any assistance appreciated.
Did you do a PUT or a POST first to store a value? There's no error
checking in the tutorial, so if you try to GET before you have stored a
value, the result would be what you see. If you want to make it safer,
add something like: