This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sijinjoseph
Recipients eric.araujo, pitrou, r.david.murray, santoso.wijaya, sijinjoseph, vstinner
Date 2011-04-25.15:17:07
SpamBayes Score 4.0418827e-06
Marked as misclassified No
Message-id <1303744628.5.0.973136616399.issue10616@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2011-04-25 15:17:08sijinjosephsetrecipients: + sijinjoseph, pitrou, vstinner, eric.araujo, r.david.murray, santoso.wijaya
2011-04-25 15:17:08sijinjosephsetmessageid: <1303744628.5.0.973136616399.issue10616@psf.upfronthosting.co.za>
2011-04-25 15:17:07sijinjosephlinkissue10616 messages
2011-04-25 15:17:07sijinjosephcreate