Message134390
Looking at object.h the buffer interface is defined as
/* buffer interface */
typedef struct bufferinfo {
void *buf;
PyObject *obj; /* owned reference */
Py_ssize_t len;
Py_ssize_t itemsize; /* This is Py_ssize_t so it can be
pointed to by strides in simple case.*/
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
Py_ssize_t smalltable[2]; /* static store for shape and strides of
mono-dimensional buffers. */
void *internal;
} Py_buffer;
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
typedef struct {
getbufferproc bf_getbuffer;
releasebufferproc bf_releasebuffer;
} PyBufferProcs;
The code that's throwing that error looks like
if (pb == NULL || pb->bf_getbuffer == NULL) {
PyErr_SetString(PyExc_TypeError,
"expected an object with the buffer interface");
I would argue that the error message gives appropriate information because it is expecting the object to have a bf_getbuffer member.
Maybe the friendly error message is best handled at a higher level? |
|
Date |
User |
Action |
Args |
2011-04-25 15:17:08 | sijinjoseph | set | recipients:
+ sijinjoseph, pitrou, vstinner, eric.araujo, r.david.murray, santoso.wijaya |
2011-04-25 15:17:08 | sijinjoseph | set | messageid: <1303744628.5.0.973136616399.issue10616@psf.upfronthosting.co.za> |
2011-04-25 15:17:07 | sijinjoseph | link | issue10616 messages |
2011-04-25 15:17:07 | sijinjoseph | create | |
|