CSV download fails if query tab has atypical characters
SQL Lab CSV download fails if the tab name has Chinese characters in it.
Expected results
Successful download
Actual results
INTERNAL SERVER ERROR
Logs:
File "/usr/local/lib/python3.6/dist-packages/gunicorn/http/wsgi.py", line 326, in write
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 223-227: ordinal not in range(256)
How to reproduce the bug
- Change sqllab tab name to 你好
- Run an arbitrary query
- Download csv
- 😢
Environment
(please complete the following information):
- superset version: up to date with master (last commit
a005e4568f14f32be23c317dc484b904ddc71dd9) - python version: 3.6.8
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- [X] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [X] I have reproduced the issue with at least the latest released version of superset.
- [X] I have checked the issue tracker for the same issue and I haven't found one similar.
Note that this failure may be specific to implementations where the flask server is run with gunicorn. I'm not sure if this is a Superset bug or a gunicorn bug
Same problems discover here.
It seemed to be a superset bug when dealing with header which should be latin-1 encoding. (May be related to https://github.com/benoitc/gunicorn/issues/1778 ) And a possible solution provided here: https://github.com/apache/incubator-superset/issues/5377
I'm able to reproduce
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.