Message235276
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). |
|
Date |
User |
Action |
Args |
2015-02-02 17:29:19 | skrah | set | recipients:
+ skrah, vstinner, larry, serhiy.storchaka |
2015-02-02 17:29:19 | skrah | link | issue23376 messages |
2015-02-02 17:29:19 | skrah | create | |
|