[Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

Wes McKinney wesmckinn at gmail.com
Mon Oct 24 21:51:21 CEST 2011

On Mon, Oct 24, 2011 at 2:40 PM, Wes McKinney <wesmckinn at gmail.com> wrote:
> On Mon, Oct 24, 2011 at 3:37 PM, Dag Sverre Seljebotn
> <d.s.seljebotn at astro.uio.no> wrote:
>> On 10/24/2011 09:26 PM, Wes McKinney wrote:
>>> I've been using
>>> ndarray[uint8_t, cast=True] bool_arr
>>> to work with dtype=bool arrays in Cython lately. When testing using
>>> Python 2.5 / NumPy 1.6.1 on Windows, I'm getting "unknown dtype code
>>> in numpy.pxd (0)". Everything works fine with Python 2.6/2.7 and NumPy
>>> 1.6.1. This is with Cython 0.15.1.
>>> Any advice or do I have to (very unhappily) work around this?
>> Is this a recent bug in Cython? Try to bisect the the Cython release (and if
>> it turns out to be Cython, possible commit).
>> Dag Sverre
>> _______________________________________________
>> cython-devel mailing list
>> cython-devel at python.org
>> http://mail.python.org/mailman/listinfo/cython-devel
> I'll check the HEAD revision and bisect if I can, don't have a lot of
> time-- it's just strange that it's Python 2.5 only.

For some reason I can't build Cython (0.15.1 or git HEAD) with mingw32:

C:\cython>python setup.py install
running install
running build
running build_py
running build_ext
building 'Cython.Compiler.Scanning' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python25\include -IC:\Pytho
n25\PC -c Cython\Compiler\Scanning.c -o build\temp.win32-2.5\Release\cython\comp
Cython\Compiler\Scanning.c:13340: error: initializer element is not constant
Cython\Compiler\Scanning.c:13340: error: (near initialization for `__pyx_CyFunct
error: command 'gcc' failed with exit status 1


I've half a mind to drop Python 2.5 support in pandas over this...

More information about the cython-devel mailing list