Message286761
- if (PyObject_GetBuffer(input, &vbuf, PyBUF_SIMPLE) < 0)
- return NULL;
Oh by the way, I forgot to mention a subtle change. PyObject_GetBuffer(PyBUF_SIMPLE) is less strict that PyArg_Parse("y#") / "buffer" converter of Argument Clinic: getargs.c also checks that the buffer is contiguous, extract of getbuffer():
if (!PyBuffer_IsContiguous(view, 'C')) {
PyBuffer_Release(view);
*errmsg = "contiguous buffer";
return -1;
}
I don't know well the buffer protocol. I don't know any object which provide a non-contiguous buffer. At least, I can say that the last time I looked at this dark part of Python, the documentation was between tiny and non-existent :-/ The buffer protocol is complex but not well documented :-( |
|
Date |
User |
Action |
Args |
2017-02-02 10:57:05 | vstinner | set | recipients:
+ vstinner, larry, methane, serhiy.storchaka |
2017-02-02 10:57:05 | vstinner | set | messageid: <1486033025.36.0.712039106771.issue29300@psf.upfronthosting.co.za> |
2017-02-02 10:57:05 | vstinner | link | issue29300 messages |
2017-02-02 10:57:05 | vstinner | create | |
|