Lenard Lindstrom added the comment:
A fourth way to add __getbuffer__ and __releasebuffer__ special methods to a
Python class is through a new base class/mixin. The Py_buffer struct pointer
passed to __getbuffer__ and __releasebuffer__ is wrapped with another special
object type, which
Changes by Lenard Lindstrom le...@telus.net:
--
nosy: -kermode
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10181
___
___
Python-bugs-list
Lenard Lindstrom le...@telus.net added the comment:
Using Python reference counting and the garbage collector to control
when PyBuffer_Release is called has problems. First, it assumes the
CPython interpreter will always use reference counting. Second,
PyBuffer_Release may never get called
Lenard Lindstrom le...@telus.net added the comment:
It would if the proposed PyManagedBuffer only releases the Py_buffer
struct - calls PyBuffer_Release - when its Python reference count goes
to zero. So a separate reference count will be maintained instead
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
Changes by Lenard Lindstrom le...@telus.net:
--
nosy: +kermode
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10181
___
___
Python-bugs-list
Lenard Lindstrom le...@telus.net added the comment:
This will work for bf_getbuffer, though having PyObject_GetBuffer set
the obj field before passing it to the callback might be safer. Also,
this does not address the case with wrapper types like memoryview. What
happens if ~Py_buffer.obj
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
New submission from Lenard Lindstrom le...@telus.net:
Python 3.2a2+ (py3k:85072M, Sep 29 2010, 12:11:17) (from SVN)
[GCC 4.4.5 20100728 (prerelease)] on linux2 (Debian squeeze)
The ~Py_buffer.obj field is undocumented. Yet memoryview, that acts as a
wrapper, includes the field in gc traversal
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
Lenard Lindstrom le...@telus.net added the comment:
I don't know why you're saying that. The purpose of PyBuffer_Release is
precisely to solve these kinds of use cases (where you want timely
release of a resource rather than rely on the garbage collector).
Yes, I was unclear. This refers
Lenard Lindstrom le...@telus.net added the comment:
That is perfectly fine with me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9602
Lenard Lindstrom le...@telus.net added the comment:
PEP 3118
Rationale
...
3) There is no way for a consumer to tell the buffer-API-exporting object it is
finished with its view of the memory and therefore no way for the exporting
object to be sure that it is safe to reallocate the pointer
Lenard Lindstrom le...@telus.net added the comment:
I have checked over the proposed patch and made a small change that more
elegantly obtains PyCArrayType. Decaying arrays into pointers is not an ideal
solution. Ctypes arrays have bounds checking (pointers do not) adding an extra
margin
Lenard Lindstrom le...@telus.net added the comment:
I will check it out.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1800
___
___
Python-bugs
Lenard Lindstrom le...@telus.net added the comment:
Here is the build with Python 2.6.2. It works now.
C:\pygame\bug2698python setup.py build --compiler=mingw32 --verbose
running build
running build_ext
building 'simple' extension
creating build
creating build\temp.win32-2.6
creating build
Lenard Lindstrom le...@telus.net added the comment:
notepad.exe forms a side-by-side assembly with COMCTL32.DLL. So
SystemRoot must be included in the environment. The following example
works with Python 2.5.2 on Windows XP.
===
import
Lenard Lindstrom le...@telus.net added the comment:
The notepad example works with Pythons 2.4.4 and 2.5.4 on Windows 98. So
something changed in Windows XP. The 0xc0150004 error code crops up when
a side-by-side assembly fails to load. The DLL loader appears to use the
SystemRoot environment
New submission from Lenard Lindstrom le...@telus.net:
http://www.python.org/doc/2.6/glossary.html
The decorator entry in the Python 2.6 documentation incorrectly
describes a decorator as merely syntactic sugar. It is not, as this
example shows:
def decorator(f):
f.prev = globals()[f
Lenard Lindstrom le...@telus.net added the comment:
It is distinct behavior. Without a decorator a new function is
immediately assigned to the identifier. Any previous reference is lost.
A decorator postpones assignment until the decorator returns. That
allows the decorator to access
Lenard Lindstrom le...@telus.net added the comment:
The claim merely syntactic sugar implies that the inverse is also
true, the decorator expression:
@do_something
def foo():
can be replaced it with:
def foo():
foo = do_something(foo)
This is guaranteed if do_something
New submission from Lenard Lindstrom [EMAIL PROTECTED]:
Python 2.6b2 (r26b2:65106, Jul 18 2008, 18:22:27) [MSC v.1500 32 bit
(Intel)] on win32
Windows XP Professional, SP 2
Library class subprocess.Popen
When subprocess.Popen is used to start the python interpreter as a
subprocess
New submission from Lenard Lindstrom [EMAIL PROTECTED]:
Python 2.6a2 on Windows XP
Distutils fails to build an extension module for MinGW. Even though
mingw32 is specified as the compiler distutils.msvc9compiler is still
loaded and it cannot find vcvarsall.bat. Here is an example:
Microsoft
New submission from Lenard Lindstrom [EMAIL PROTECTED]:
subprocess.Popen.communicate is documented as taking a string as the
input argument. Instead is accepts only a binary stream (bytes).
Python 3.0a4 (r30a4:62126, Apr 3 2008, 15:34:18) [MSC v.1500 32 bit
(Intel)] on
win32
Type help
Lenard Lindstrom [EMAIL PROTECTED] added the comment:
distutils.version.StrictVersion.parse does not handle x.y.z.n . That is
why there is an exception. I have tested the patch both with
binutils-2.18.50-20080109 (*), the latest version (a Technology
Preview), and its predecessor binutils
New submission from Lenard Lindstrom:
The install command returns the following error when the --compiler
option is provided on the command line:
python setup.py install --compiler=mingw32
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2
Lenard Lindstrom added the comment:
Yes, setup.py build --compiler=mingw32 install works. It is good
enough for me.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2056
New submission from Lenard Lindstrom:
When a callback is created with an array argument and then is called
from Python the callback function receives an array full of garbage.
Here is an example:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type help
28 matches
Mail list logo