[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2012-03-01 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Since this issue targeted 2.7 and 3.2: In a brief discussion on python-dev it was decided that the 3.3 fixes from #10181 won't be backported for a number of reasons, see:

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2012-02-25 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3f9b3b6f7ff0 by Stefan Krah in branch 'default': - Issue #10181: New memoryview implementation fixes multiple ownership http://hg.python.org/cpython/rev/3f9b3b6f7ff0 -- nosy: +python-dev

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2012-02-09 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I ran the demo in the pep-3118 repo, and it is fixed (see #10181): $ ./bufrel Accessing buffer directly... Accessing buffer through a memory view... Done. -- dependencies: -Problems with Py_buffer management in memoryobject.c

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2011-08-10 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: This should be fixed with the ManagedBuffer implementation from #10181. -- dependencies: +Problems with Py_buffer management in memoryobject.c (and elsewhere?) nosy: +skrah ___ Python tracker

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2011-06-25 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: mark.dickinson - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9990 ___ ___

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2011-02-07 Thread Lenard Lindstrom
Lenard Lindstrom le...@telus.net added the comment: I think only a simple solution is needed. From my experience adding the new buffer protocol to pygame.mixer.Sound it would be easy enough for bf_releasebuffer to use the internal field to free memory allocated by bf_getbuffer. As long as

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2011-01-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As per the discussion over in issue #10181, I've changed my position on this issue. Since the PEP isn't explicit on the exact semantics here, I think we should be guided by the memoryview behaviour and make it official that bf_releasebuffer

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2011-01-07 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The alternative (if we declare that clients should treat Py_buffer contents as completely read-only) is to update memoryview to include a separate orig_view field that would never be touched. The GetBuffer and ReleaseBuffer calls would then

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-22 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Antoine, a couple of questions: (1) Is there documentation for the 'smalltable' field of the Py_buffer struct anywhere? What are the requirements for the exporter here? E.g., is it / should it be a requirement that shape, strides and

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (1) Is there documentation for the 'smalltable' field of the Py_buffer struct anywhere? What are the requirements for the exporter here? No, and no particular requirements AFAIR. It is a piece of internal storage aimed at avoiding the nagging

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'll take a look at this. -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9990 ___

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: That's because the new buffer protocol doesn't define ownership of Py_buffer structs. As a result, nothing can be assumed at to which piece of code is responsible for allocation and deallocation of related memory areas (such as shapes and

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-16 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The PEP is quite clear that the object providing the buffer owns those fields. Last time I checked, the memoryview implementation appeared broken because it didn't respect that ownership (and created the potential for confusion on the topic).

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-12-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: pitrou - nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9990 ___ ___

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a patch that fixes the issue. Can you try it? Unfortunately, more advanced uses such a slicing the memoryview are still crashing. That's because the new buffer protocol doesn't define ownership of Py_buffer structs. As a result, nothing

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Of course, a patch is always better without the debugging prints :) -- Added file: http://bugs.python.org/file19089/memview.patch ___ Python tracker rep...@bugs.python.org

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file19088/memview.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9990 ___

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-10-01 Thread Lenard Lindstrom
Lenard Lindstrom le...@telus.net added the comment: Applied patch to: Python 3.2a2+ (py3k:85150M, Oct 1 2010, 14:40:33) [GCC 4.4.5 20100728 (prerelease)] on linux2 Python unit test test_capi.py crashes: internal test_broken_memoryview * ob object : refcnt 0 at 0xb7171178 type: str

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-09-29 Thread Lenard Lindstrom
New submission from Lenard Lindstrom le...@telus.net: If an exporter returns a Py_buffer with ndim 1, PyMemoryView_FromObject changes the shape and strides pointer fields to point to a local Py_buffer array field. This array field is undocumented. Any heap memory these pointers reference is

[issue9990] PyMemoryView_FromObject alters the Py_buffer after calling PyObject_GetBuffer when ndim 1

2010-09-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - pitrou nosy: +pitrou stage: - needs patch versions: +Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9990 ___