facing UnicodeDecodeError #533
Replies: 2 comments 6 replies
-
What database do you use? |
Beta Was this translation helpful? Give feedback.
-
@methane we were not able to update to mysqlclient 2.1.0. Instead we manually executed We are still facing the same issue, so we added logs in production code to get the result of mysql charset returned and we observed that it was random between Also few more details:
I knew a case which was related to mysql server and client version out-of-sync leading to this issue (from mysql docs), but this does't seem the case. We are not able to figure out why its random. Any idea if its related to proxysql or anything you can point to? or maybe due to server load ? |
Beta Was this translation helpful? Give feedback.
-
I am using sqlalchemy as interface to mysqlclient to connect to mysql .
I am currently facing this issue:
I am using utf-8 charset for my table and column both and my connection string uses
?charset=utf8
(which in turn sets mysqlclient charset to utf8 as well).String stored in db column is:
here, while fetching this string, mysql encodes
–
withlatin1
encoding (iecp1252
) ( which i am not sure why )But while decoding, mysqlclient tries to decode it using
utf8
, which throws the above error.In our business logic, a snapshot of the DB gets created everytime which is used for querying and is then disposed. So this issue occurs randomly and gets resolved on retry (may be db snapshot issue ?). If it's db issue can anyone suggest why mysql server is defaulting back to default encoding (
latin1
) ?Overall, can anyone please suggest any reason for this to occur ?
My env:
Beta Was this translation helpful? Give feedback.
All reactions