keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
348 stars 138 forks source link

builtins.AttributeError #150

Closed lotuswater closed 6 years ago

lotuswater commented 6 years ago

I got an AttributeError when I start a restful client of alice2 with debug mode:

AttributeError: 'dict' object has no attribute 'method'

Traceback( call stack): File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1997, in call return self.wsgi_app(environ, start_response) File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "D:\Program Files\Python36\lib\site-packages\flask_compat.py", line 33, in reraise raise value File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "D:\Program Files\Python36\lib\site-packages\flask_compat.py", line 33, in reraise raise value File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "D:\Program Files\Python36\lib\site-packages\flask\app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "E:\GitHub\program-y\src\programy\clients\restful\flask\client.py", line 101, in ask return REST_CLIENT.create_response(response_data, status) File "E:\GitHub\program-y\src\programy\clients\restful\flask\client.py", line 54, in create_response self.dump_request(response_data) File "E:\GitHub\program-y\src\programy\clients\restful\flask\client.py", line 84, in dump_request if request.method == 'POST':


I found that in function "create_response" at program-y/src/programy/clients/restful/flask/client.py:54, invoke function "dump_request" with argument "response_data", but a flask.request object should be give I think!

keiffster commented 6 years ago

Found the issue and will release a fix later this evening, until then just run with debug=False in config

keiffster commented 6 years ago

Thats now pushed to master