Open UTevZrmnvP opened 6 years ago
Is this an issue you can tackle? PRs are welcome.
What are the steps to reproduce? I tried to test this and it seemed to work fine.
@UTevZrmnvP can you provide the steps to reproduce?
When testing with Python 2.7.12 the 500 internal error is reproducible if you include an emoji with the slash command.
/standup 👍
or any Unicode emoji will crash with the following output:
[2020-03-12 19:12:14,879] ERROR in app: Exception on /standup [POST]
Traceback (most recent call last):
File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "standup.py", line 43, in slash_command
form_text,
UnicodeEncodeError: 'ascii' codec can't encode character u'\U0001f61a' in position 0: ordinal not in range(128)
54.183.150.245 - - [12/Mar/2020 19:12:14] "POST /standup HTTP/1.1" 500 -
Note that the 500 error only happens when you paste in an emoji, but if you include an emoji like /standup :+1:
then it does not error.
When using emoji (not in markdown format) passed to the /standup command the server throws a 500. internal server error.
This may be the correct behavior, but could we have a more informative error instead ("input validation failed, see FAQ for known issues"?).