Martin Panter added the comment:

I tend to agree with Serhiy about Eryksun’s patch. I understand it solves the 
current problem, and continues to protect against this scenario:

>>> b = bytearray(b"a")
>>> c = ctypes.c_char.from_buffer(b)
>>> b *= 1000
BufferError: Existing exports of data: object cannot be re-sized

PyObject_AsWriteBuffer() and PyBuffer_Release() did get changed in 3.4, also by 
Issue 22896. Reviewing the history (mainly 
<https://hg.python.org/cpython/diff/1da9630e9b7f/Objects/abstract.c>), the only 
behaviour change I see is that it now clears view->obj to NULL, via the new 
PyBuffer_Release() call, before calling DECREF on the object.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to