apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.81k stars 13.88k forks source link

when download a CSV file got a UnicodeEncodeError #9429

Closed willre closed 4 years ago

willre commented 4 years ago

When I download a csv file, the webpage prompts an internal service error, I check the log file, The log reported an UnicodeEncodeError error.

log content: [2020-04-01 12:25:16 +0800] [32345] [ERROR] Error handling request /superset/explore_json/?form_data=%7B%22slice_id%22%3A16%7D&csv=true Traceback (most recent call last): File "/usr/local/python-3.7.3/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/usr/local/python-3.7.3/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 182, in handle_request resp.write(item) File "/usr/local/python-3.7.3/lib/python3.7/site-packages/gunicorn/http/wsgi.py", line 333, in write self.send_headers() File "/usr/local/python-3.7.3/lib/python3.7/site-packages/gunicorn/http/wsgi.py", line 329, in send_headers util.write(self.sock, util.to_bytestring(header_str, "ascii")) File "/usr/local/python-3.7.3/lib/python3.7/site-packages/gunicorn/util.py", line 507, in to_bytestring return value.encode(encoding) UnicodeEncodeError: 'ascii' codec can't encode characters in position 226-228: ordinal not in range(128)

superset info: $ pip3 show superset Name: superset Version: 0.28.1 Summary: A modern, enterprise-ready business intelligence web application Home-page: https://github.com/apache/incubator-superset Author: Maxime Beauchemin Author-email: maximebeauchemin@gmail.com License: Apache License, Version 2.0 Location: /usr/local/python-3.7.3/lib/python3.7/site-packages Requires: bleach, boto3, botocore, celery, click, colorama, contextlib2, cryptography, flask, flask-appbuilder, flask-caching, flask-compress, flask-migrate, flask-wtf, flower, future, geopy, gunicorn, humanize, idna, isodate, markdown, pandas, parsedatetime, pathlib2, polyline, pydruid, pyhive, python-dateutil, python-geohash, pyyaml, requests, simplejson, sqlalchemy, sqlalchemy-utils, sqlparse, tableschema, thrift, thrift-sasl, unicodecsv, unidecode Required-by:

stale[bot] commented 4 years ago

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.