-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python ASCII codec error for queries with characters not in ASCII #2618
Comments
@RichardLitt Why do you think it's related to the frontend? Can anyone tell me how I can find the file / line number responsible for this error? |
@AntoineAugusti I mess up sometimes. Renamed. |
@arikfr Would you be able to help on this? I did not find what is causing this. |
I had the same issue with
but it was resolved by adding a following line to my
and restarting services by
The detail is, in my case, when I ran a query
it returned the same error with the stack trace below
As this trace, I thought it didn't come from the original query to DB but from saving the result into the internal PostgreSQL temporally. If Redash is installed on clean Ubuntu env, internal Postgres should be
It looks if there is no encoding configuration, Redash should use In
so I thought overwriting it with an explicit encoding would work and actually, that works. I hope it helps solving the issue. |
I tried to do what you suggested @tatsushid but it didn't work for me. The stack trace was a bit different:
I solved this issue by adding an encoding cast at the beginning of this method: redash/redash/query_runner/pg.py Line 153 in 4685887
query = query.encode('utf-8') but it's definitely not pretty. Any better way to solve this? |
I know this is an old post but changing the code did not help me. I removed pg.py and pg.pyc and it didnt show me any error. What do I have to do to apply this changes? |
Issue Summary
I get an encoding error when writing a query with characters that are not encoded in ascii. I think I first installed Redash in its v3 and upgraded to v4. Because I did start at v4, I don't really know how to fix the issue
It looks similar to #2228
Steps to Reproduce
/queries/new
select 'à'
Error running query: 'ascii' codec can't encode character u'\xe0' in position 196: ordinal not in range(128)
Technical details:
4.0.1+b4038
The text was updated successfully, but these errors were encountered: