You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async with GetDBConnectionContext() as conn:
async with conn.cursor() as cur:
await cur.execute("SELECT * FROM user WHERE username=%s", (username,))
bug发生
Expected behavior
返回的连接对象中的游标对象成功执行sql语句并返回结果
Logs/tracebacks
[2024-05-11 14:11:30.069| ERROR |MainThread|mysql.login_user|UserControllers.py:57]: 登录用户时发生错
误: 'NoneType' object has no attribute 'send'
Traceback (most recent call last):
File "f:\python_play\furina-fastapi-backend\backend\utils\UserControllers.py", line 34, in login_user await cur.execute("SELECT * FROM user WHERE username=%s", (username,))
File "G:\python3.12.3\Lib\site-packages\aiomysql\cursors.py", line 239, in executeawaitself._query(query)
File "G:\python3.12.3\Lib\site-packages\aiomysql\cursors.py", line 457, in _queryawait conn.query(q)
File "G:\python3.12.3\Lib\site-packages\aiomysql\connection.py", line 468, in queryawaitself._execute_command(COMMAND.COM_QUERY, sql)
File "G:\python3.12.3\Lib\site-packages\aiomysql\connection.py", line 724, in _execute_commandself._write_bytes(prelude + sql[:chunk_size -1])
File "G:\python3.12.3\Lib\site-packages\aiomysql\connection.py", line 669, in _write_bytesreturnself._writer.write(data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\python3.12.3\Lib\asyncio\streams.py", line 346, in writeself._transport.write(data)
File "G:\python3.12.3\Lib\asyncio\proactor_events.py", line 366, in writeself._loop_writing(data=bytes(data))
File "G:\python3.12.3\Lib\asyncio\proactor_events.py", line 402, in _loop_writingself._write_fut =self._loop._proactor.send(self._sock, data)
^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'NoneType' object has no attribute 'send'
Python Version
$ python --version3.12.3
aiomysql Version
$ python -m pip show aiomysqlName: aiomysqlVersion: 0.2.0Summary: MySQL driver for asyncio.Home-page: https://github.com/aio-libs/aiomysqlAuthor: Nikolay NovikAuthor-email: nickolainovik@gmail.comLicense: MITLocation: G:\python3.12.3\Lib\site-packagesRequires: PyMySQLRequired-by:
PyMySQL Version
$ python -m pip show PyMySQLName: PyMySQLVersion: 1.1.0Summary: Pure Python MySQL DriverHome-page:Author:Author-email: Inada Naoki <songofacandy@gmail.com>, Yutaka Matsubara <yutaka.matsubara@gmail.com>License: MIT LicenseLocation: G:\python3.12.3\Lib\site-packagesRequires:Required-by: aiomysql
SQLAlchemy Version
$ python -m pip show sqlalchemy
OS
windows
Database type and version
SELECT VERSION();8.4.0
Additional context
No response
Code of Conduct
I agree to follow the aio-libs Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
返回的连接对象的游标对象执行sql语句的时候发生了bug
To Reproduce
async with GetDBConnectionContext() as conn:
async with conn.cursor() as cur:
await cur.execute("SELECT * FROM user WHERE username=%s", (username,))
bug发生
Expected behavior
返回的连接对象中的游标对象成功执行sql语句并返回结果
Logs/tracebacks
Python Version
aiomysql Version
PyMySQL Version
SQLAlchemy Version
$ python -m pip show sqlalchemy
OS
windows
Database type and version
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: