Skip to content

Commit

Permalink
fix(mysql): force version 9.X of mysql-connector-python
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRunner committed Jul 17, 2024
1 parent 9f69c63 commit 82b1c93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/database/query/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ async def _format_query_c(cursor: CMySQLCursor, operation: str | bytes, params:
# pylint: disable=protected-access
try:
if isinstance(operation, str):
stmt = operation.encode(cursor._cnx.python_charset)
stmt = operation.encode(cursor._connection.python_charset)
else:
stmt = operation
except (UnicodeDecodeError, UnicodeEncodeError) as err:
raise errors.ProgrammingError(str(err))

if params:
prepared = cursor._cnx.prepare_for_mysql(params)
prepared = cursor._connection.prepare_for_mysql(params)
if isinstance(prepared, dict):
for key, value in prepared.items():
stmt = stmt.replace(f"%({key})s".encode(), value)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ i18nice~=0.15.0
imageio
isbnlib
LRFutils==0.1.2
mysql-connector-python>=8.0
mysql-connector-python~=9.0
nltk>=3.7
Pillow~=10.3.0
psutil>=5.8
Expand Down

0 comments on commit 82b1c93

Please sign in to comment.