You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2017/11/29 08:43:56 UTC
[GitHub] rumbin opened a new issue #3952: [SQLLab, CSV export] UnicodeEncodeError when tab/filename contains non-ascii characters
rumbin opened a new issue #3952: [SQLLab, CSV export] UnicodeEncodeError when tab/filename contains non-ascii characters
URL: https://github.com/apache/incubator-superset/issues/3952
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 any
- [ ] 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
### Superset version
0.20.5; sorry, I don't have 0.20.6 at hand right now
### Expected results
Exporting a query in SQLLab to CSV works regardless of the presence of non-ascii characters in the tab label.
### Actual results
If a tab cointains non-ascii characters , like e.g. '?', the following error is thrown:
```
2017-11-29 09:40:07,000:INFO:root:Exporting CSV file [Hkqwzx3gM]
2017-11-29 09:40:07,004:INFO:root:Parsing with sqlparse statement SELECT 1
2017-11-29 09:40:07,004:INFO:root:Fetching CSV from results backend [41ae1238-57cf-4a5a-ba21-7ff2776062d3]
2017-11-29 09:40:07,005:INFO:root:Decompressing
2017-11-29 09:40:07,006:INFO:root:Using pandas to convert to CSV
2017-11-29 09:40:07,006:INFO:root:Ready to return response
[2017-11-29 09:40:07 +0100] [79851] [ERROR] Error handling request /superset/csv/Hkqwzx3gM
Traceback (most recent call last):
File "/opt/apps/superset/venv_superset_0.20.5/lib64/python3.4/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request(listener, req, client, addr)
File "/opt/apps/superset/venv_superset_0.20.5/lib64/python3.4/site-packages/gunicorn/workers/sync.py", line 182, in handle_request
resp.write(item)
File "/opt/apps/superset/venv_superset_0.20.5/lib64/python3.4/site-packages/gunicorn/http/wsgi.py", line 341, in write
self.send_headers()
File "/opt/apps/superset/venv_superset_0.20.5/lib64/python3.4/site-packages/gunicorn/http/wsgi.py", line 337, in send_headers
util.write(self.sock, util.to_bytestring(header_str, "ascii"))
File "/opt/apps/superset/venv_superset_0.20.5/lib64/python3.4/site-packages/gunicorn/util.py", line 509, in to_bytestring
return value.encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 206: ordinal not in range(128)
```
### Steps to reproduce
Rename a tab to, e.g., '?', run a query and try to expoprt it.
------------
I suspect that the filename generated from the tab label is the culprit.
If gunicorn can't handle noin-ascii characters, they would have to be replaced, I guess...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services