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

2006-06-06 Thread Brett Cannon
On 6/6/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 6/6/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > > 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_ge

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

2006-06-06 Thread Guido van Rossum
On 6/6/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > 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

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

2006-06-06 Thread Brett Cannon
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