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.

classification
Title: incorrect comments for PyObject_ReleaseBuffer
Type: behavior Stage: test needed
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2, pitrou, teoliphant
Priority: normal Keywords:

Created on 2008-07-05 22:05 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg69303 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-07-05 22:05
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
        */
msg87925 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-05-16 20:34
Travis,
How should code, comment and PEP be reconciled?
msg87927 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-16 20:41
PyObject_ReleaseBuffer() is dead actually.
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47543
2009-05-16 20:41:49pitrousetstatus: open -> closed
resolution: out of date
messages: + msg87927
2009-05-16 20:34:34ajaksu2setnosy: + ajaksu2
messages: + msg87925

type: behavior
stage: test needed
2008-07-22 16:01:41pitrousetpriority: normal
nosy: + teoliphant
2008-07-05 22:05:02pitroucreate