Christopher Barker wrote: > HI all, > > File > "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", > line 2814, in SetDataBuffer > return _core_.Image_SetDataBuffer(*args, **kwargs) > TypeError: non-character array cannot be interpreted as character buffer > > If I try to pass in a numpy array, while it works great with a > numarray array.
This error sounds like wx is using the *wrong* buffer protocol. Don't use bf_getcharbuffer as it is of uncertain utility. It is slated for removal from Python 3000. It was meant to be used as a way to determine buffers that were supposed to contain characters (not arbitrary data). Just use bf_getreadbuffer and bf_getwritebuffer from tp_as_buffer. More support for the buffer protocol all the way around is a good idea. NumPy has always supported it very well (just make sure to use it correctly). FYI, I'm going to write a PEP to get the array protocol placed as an add-on to the buffer protocol for Python 2.6 -Travis ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion