[issue14203] bytearray_getbuffer: unnecessary code

Kelley Nielsen report at bugs.python.org
Sun Jun 8 00:51:54 CEST 2014


Kelley Nielsen added the comment:

I have verified that this feature is unused in the source tree; in fact, there are no internal calls to bytearray_getbuffer() at all. The only thing bytearray_getbuffer() does with its second arg is pass it to PyBuffer_FillInfo(), which immediately checks it and passes 0 up the call stack if it is NULL. (A comment in PyBuffer_FillInfo() asks why -1 is not passed up instead; it's probably to distinguish this feature from the error condition handled in the immediately following conditional block.)

There are potentially other issues stemming from this legacy feature in bytearray_getbuffer(), PyBuffer_FillInfo(), and elsewhere. The maintainers may see fit to open tickets on these issues as well.

There's more relevant commentary on the feature here: http://comments.gmane.org/gmane.comp.python.devel/130521

----------
nosy: +kelleynnn
versions: +Python 3.5 -Python 3.3

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


More information about the Python-bugs-list mailing list