Message253950
| Author |
martin.panter |
| Recipients |
JakeMont, jnoller, martin.panter, r.david.murray, sbt, serhiy.storchaka, skrah, zach.ware |
| Date |
2015年11月02日.23:41:03 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446507664.19.0.95824730029.issue25498@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|