adeshpande3 / Facebook-Messenger-Bot

Facebook chatbot that I trained to talk like me using Seq2Seq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File "/app/app.py", line 58, in prediction -- AttributeError: 'NoneType' object has no attribute 'fileno'

subhub74 opened this issue · comments

Hi all,

Getting 'NoneType' object has no attribute 'fileno' error from app/app.py. And, getting TypeError: 'NoneType' object is not subscriptable error. Any insights/hint on these errors? Advanced thanks for your input on this issue.

Heroku App:
2018-06-17T06:55:58.697306+00:00 app[web.1]: File "/app/app.py", line 58, in prediction
2018-06-17T06:55:58.697308+00:00 app[web.1]: response = pred(str(request.json['message']))
2018-06-17T06:55:58.697317+00:00 app[web.1]: TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last):
File "c:\Chatbot-Flask-Server-master\app.py", line 67, in
app.run(debug=True)
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\flask\app.py", line 938, in run
cli.show_server_banner(self.env, self.debug, self.name, False)
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\flask\cli.py", line 629, in show_server_banner
click.echo(message)
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\click\utils.py", line 217, in echo
file = _default_text_stdout()
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\click_compat.py", line 621, in func
rv = wrapper_func()
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\click_compat.py", line 385, in get_text_stdout
rv = _get_windows_console_stream(sys.stdout, encoding, errors)
File "C:\Users\sriranga\AppData\Local\Continuum\anaconda3\lib\site-packages\click_winconsole.py", line 261, in _get_windows_console_stream
func = _stream_factories.get(f.fileno())
AttributeError: 'NoneType' object has no attribute 'fileno'

Might be a problem with request.json['message'] being empty.