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
Did you install asyncpg with pip?: yes, but from local git checkout
If you built asyncpg locally, which version of Cython did you use?: asyncpg/.eggs/Cython-0.29.21
Can the issue be reproduced under both asyncio and uvloop?: yes
How to reproduce
importasyncioimportasyncpgfromdatetimeimportdateimportuvloopuvloop.install()
classMyRecord(asyncpg.Record):
passasyncdefmain():
conn=awaitasyncpg.connect("postgresql://postgres@localhost/test")
awaitconn.execute(
"CREATE TABLE IF NOT EXISTS users(id serial PRIMARY KEY, name text, dob date)"
)
awaitconn.execute(
"INSERT INTO users(name, dob) VALUES($1, $2)", "Bob", date.today()
)
row=awaitconn.fetchrow(
"SELECT * FROM users WHERE name = $1", "Bob", record_class=MyRecord
)
# Will raise asyncpg/protocol/record/recordobj.c:562: bad argument to internal functionprint(row.items())
# Close the connection.awaitconn.close()
asyncio.get_event_loop().run_until_complete(main())