LookupError: unknown encoding: utf8mb4
roniemartinez opened this issue · 4 comments
roniemartinez commented
I added ?charset=utf8mb4
to my sqlalchemy create_engine().
Using CyMySQL, the following error shows:
File "redacted_path\lib\site-packages\cymysql\__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "redacted_path\lib\site-packages\cymysql\connections.py", line 248, in __init__
self._connect()
File "redacted_path\lib\site-packages\cymysql\connections.py", line 416, in _connect
self._request_authentication()
File "redacted_path\lib\site-packages\cymysql\connections.py", line 468, in _request_authentication
user = self.user.encode(self.charset)
LookupError: unknown encoding: utf8mb4
By just changing engine to PyMySQL, everything works perfectly.
EDIT: I am using cymysql==0.9.12
nakagami commented
Thanks
PyMySQL treat utf8mb4 as utf8 encoding.
https://github.com/PyMySQL/PyMySQL/blob/master/pymysql/charset.py#L21
I will fix it soon.
nakagami commented
Probably fIxed it.
Can you test master HEAD ? @roniemartinez
roniemartinez commented
@nakagami Working for me 👍
nakagami commented
Thanks
I have released version 0.9.13