[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-09-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-09-01 Thread Stefan Krah
Stefan Krah added the comment: In general, the number of calls to PyObject_GetBuffer() must be equal to the number of calls to PyBuffer_Release(), otherwise bad things will happen in the same way as with malloc()/free(). Now, in my test case I omitted the call to PyObject_GetBuffer() *with* the

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-08-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is what I think the test case should look like (untested): static PyObject * memoryview_from_buffer_cleanup(PyObject *self, PyObject *noargs) { PyObject *b, *view = NULL; Py_buffer info; Py_ssize_t shape[3] = {2, 2, 3}; Py_ssize_t str

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-08-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Aug 31, 2012 at 3:12 PM, Stefan Krah wrote: > Now I'm puzzled: I thought your goal was to preserve the implicit cleanup > from 3.2, i.e. PyBuffer_Release() is called when the managed buffer is > deallocated. > The issue that I raised in msg169472

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-08-31 Thread Stefan Krah
Stefan Krah added the comment: Alexander Belopolsky wrote: > I am still getting up to speed with all the changes that went in since > 3.2. I'll review your patch over the weekend. Meanwhile, I think the > goal should be that after PyMemoryview_FromBuffer(info) is called, it > should be OK to d

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-08-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Aug 31, 2012 at 2:34 PM, Stefan Krah wrote: > With the ManagedBuffer, we could now write a new function that returns > a memoryview with much nicer cleanup facilities. But that doesn't help > here since we're stuck with this function for 3.3.0. > >

[issue15821] PyMemoryView_FromBuffer() behavior change (possible regression)

2012-08-31 Thread Stefan Krah
Stefan Krah added the comment: Alexander, your test case is brilliant and could eventually go into _testbuffer.c, but I'd prefer a simpler test case for now. :) Here's a patch that restores the info.obj cleanup facility. I intentionally did not add copying the format in order to keep the diff s