[New-bugs-announce] [issue3293] incorrect comments for PyObject_ReleaseBuffer

Antoine Pitrou report at bugs.python.org
Sun Jul 6 00:05:03 CEST 2008


New submission from Antoine Pitrou <pitrou at free.fr>:

The declaration for PyObject_ReleaseBuffer (in Include/abstract.h) has
the following comments attached to it. But the part about the return
value is wrong since the function is defined as returning void. Also,
PEP 3118 says it always succeeds so it can't return an error code.

By the way, may I suggest that having the buffer API declared in
abstract.h but the Py_buffer struct declared in object.h (and why not in
bufferobject.h?) is slightly confusing.

	/* C-API version of the releasebuffer function call.  It
	   checks to make sure the object has the required function
	   pointer and issues the call.  The obj must have the buffer
	   interface or this function will cause a segfault (i.e. it
	   is assumed to be called only after a corresponding
	   getbuffer which already verified the existence of the
	   tp_as_buffer pointer).

           Returns 0 on success and -1 (with an error raised) on
           failure.  This function always succeeds (as a NO-OP) if
           there is no releasebuffer function for the object so that
           it can always be called when the consumer is done with the
           buffer
        */

----------
components: Interpreter Core
messages: 69303
nosy: pitrou
severity: normal
status: open
title: incorrect comments for PyObject_ReleaseBuffer
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3293>
_______________________________________


More information about the New-bugs-announce mailing list