superset icon indicating copy to clipboard operation
superset copied to clipboard

CSV download fails if query tab has atypical characters

Open serenajiang opened this issue 6 years ago • 4 comments

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

  1. Change sqllab tab name to 你好
  2. Run an arbitrary query
  3. Download csv
  4. 😢

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.

serenajiang avatar Feb 14 '20 01:02 serenajiang

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

etr2460 avatar Feb 14 '20 04:02 etr2460

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

crazyplum avatar Feb 18 '20 04:02 crazyplum

I'm able to reproduce

dpgaspar avatar Feb 18 '20 14:02 dpgaspar

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.

stale[bot] avatar Apr 18 '20 15:04 stale[bot]