Vi stødte på det samme problem, at BLOB'er ved en fejl blev læst tilbage som UTF-8-strenge med MySQL 8.0.13, mysql-connector-python 8.0.13 og sqlalchemy 1.2.14.
Det der gjorde tricket for os var at aktivere use_pure
mulighed for MySQL Connector
. Standarden for use_pure
havde ændret sig i 8.0.11 med den nye standard at bruge C-udvidelsen. Derfor sætter vi muligheden tilbage:
create_engine(uri, connect_args={'use_pure': True}, ...)
Detaljer om vores fejl og staksporing:
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