Buffer Interface, can't get PyObject_AsReadBuffer to work?
Kevin Cazabon
kevin at cazabon.com
Wed Apr 3 12:36:47 EST 2002
According to the Python documentation, 0 means error, 1 means
success...?
"""On success, returns 1, sets buffer to the memory location and
buffer_len to the buffer length. Returns 0 and sets a TypeError on
error"""
???
Kevin.
martin at v.loewis.de (Martin v. Loewis) wrote in message news:<m3sn6dntiy.fsf at mira.informatik.hu-berlin.de>...
> kevin at cazabon.com (Kevin Cazabon) writes:
>
> > // Convert the pInBuffer from PyObject to a PyBuffer (readable),
> > THIS DOESN'T WORK (the Python object type that is passed in as
> > inBuffer is a 'B' array)
> > if (PyObject_CheckReadBuffer(inBuffer)) {
> > //this ALWAYS returns 0, meaning unsuccessful... what's wrong???
> > ok = PyObject_AsReadBuffer(inBuffer, &pInBuffer, &p4size);
>
> 0 means success, -1 means error. Use the source, Luke.
>
> HTH,
> Martin
More information about the Python-list
mailing list