Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
subhub74 opened this issue Jun 17, 2018 · 1 comment

Comments

@subhub74
Copy link

subhub74 commented Jun 17, 2018

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'

@adeshpande3
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants