Skip to content

Commit ae5a89d

Browse files
Petr Reznikovelprans
Petr Reznikov
authored andcommitted
Fix assertion fail on copy_records_to_table
Current implementation misuses `buffertype` argument of `PyMemoryView_GetContiguous()` function. One must pass `PyBUF_READ` or `PyBUF_WRITE` since other options lead to assertion fire (in python debug mode).
1 parent 2d76f50 commit ae5a89d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: asyncpg/protocol/coreproto.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ cdef class CoreProtocol:
434434
Py_buffer *pybuf
435435

436436
mview = cpythonx.PyMemoryView_GetContiguous(
437-
data, cpython.PyBUF_SIMPLE, b'C')
437+
data, cpython.PyBUF_READ, b'C')
438438

439439
try:
440440
pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview)

0 commit comments

Comments
 (0)