Skip to content

Commit

Permalink
Fix assertion fail on copy_records_to_table
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Petr Reznikov authored and elprans committed Jul 8, 2019
1 parent 2d76f50 commit ae5a89d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asyncpg/protocol/coreproto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ cdef class CoreProtocol:
Py_buffer *pybuf

mview = cpythonx.PyMemoryView_GetContiguous(
data, cpython.PyBUF_SIMPLE, b'C')
data, cpython.PyBUF_READ, b'C')

try:
pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview)
Expand Down

0 comments on commit ae5a89d

Please sign in to comment.