A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/065646.html below:

[Python-Dev] How to fix the buffer object's broken char buffer support

[Python-Dev] How to fix the buffer object's broken char buffer support [Python-Dev] How to fix the buffer object's broken char buffer supportBrett Cannon brett at python.org
Wed Jun 7 00:29:40 CEST 2006
If you run ``import array; int(buffer(array.array('c')))`` the
interpreter will segfault.  While investigating this I discovered that
buffer objects, for their tp_as_buffer->bf_getcharbuffer, return the
result by calling the wrapped object bf_getreadbuffer or
bf_getwritebuffer.  This is wrong since it is essentially redirecting
the expected call to the wrong tp_as_buffer slot for the wrapped
object.  Plus it doesn't have Py_TPFLAGS_HAVE_GETCHARBUFFER defined.

I see two options here.  One is to remove the bf_getcharbuffer slot
from the buffer object.  The other option is to fix it so that it only
returns bf_getcharbuffer and doesn't redirect improperly (this also
brings up the issue if Py_TPFLAGS_HAVE_GETCHARBUFFER should then also
be defined for buffer objects).

Since I don't use buffer objects I don't know if it is better to fix
this or just rip it out.

-Brett
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4