Stefan Krah added the comment: STINNER Victor wrote: > I don't understand the link between third party extensions and > test_getargs2. test_getargs2 is a unit test for non-regression of > CPython. Can you please elaborate?
A test failure needs a broken buffer provider that hands out a non-contiguous buffer in response to a PyBUF_SIMPLE request. The only non-contiguous buffer provider in the stdlib is memoryview. If I break memoryview's getbufferproc ... diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -1465,11 +1465,6 @@ return -1; } if (!REQ_STRIDES(flags)) { - if (!MV_C_CONTIGUOUS(baseflags)) { - PyErr_SetString(PyExc_BufferError, - "memoryview: underlying buffer is not C-contiguous"); - return -1; - } view->strides = NULL; } if (!REQ_SHAPE(flags)) { ... test_buffer already fails. So what should I test? Perhaps ctypes has some capabilities that I'm unaware of. If I'm using _testbuffer.ndarray(), I'm effectively testing that the getbufferproc of ndarray is correct (which is also tested multiple times in test_buffer). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23376> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com