Encontramos o mesmo problema que os BLOBs foram lidos erroneamente como strings UTF-8 com MySQL 8.0.13, mysql-connector-python 8.0.13 e sqlalchemy 1.2.14.
O que funcionou para nós foi habilitar o
use_pure
opção de conector MySQL
. O padrão de use_pure
foi alterado em 8.0.11 com o novo padrão para usar a extensão C. Assim, voltamos a opção:create_engine(uri, connect_args={'use_pure': True}, ...)
Detalhes do nosso erro e rastreamento de pilha:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
....
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 272, in execute
self._handle_result(result)
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 163, in _handle_result
self._handle_resultset()
File "/usr/local/lib/python3.6/site-packages/mysql/connector/cursor_cext.py", line 651, in _handle_resultset
self._rows = self._cnx.get_rows()[0]
File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 273, in get_rows
row = self._cmysql.fetch_row()
SystemError: <built-in method fetch_row of _mysql_connector.MySQL object at 0x5627dcfdf9f0> returned a result with an error set