Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3293] incorrect comments for PyObject_ReleaseBuffer

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 5, 2008, 3:05 PM

Post #1 of 1 (47 views)
Permalink
[issue3293] incorrect comments for PyObject_ReleaseBuffer

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>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.