Eduardo Lenz | 5 Dec 18:06 2011
Picon

Unicode and numpy

Hi,

after adding  #cython: language_level=3   in my .pxd files I got the following error messages

Error compiling Cython file:
------------------------------------------------------------
...
                # need to call releasebuffer
                info.obj = self

            if not hasfields:
                t = descr.type_num
                if ((descr.byteorder == '>' and little_endian) or
                                       ^
------------------------------------------------------------

/usr/lib/python3.2/site-packages/Cython/Includes/numpy.pxd:254:40: Unicode literals do not support coercion to C types other than Py_UNICODE or Py_UCS4.


I tried with stable and cython-git 20111205-1 versions, with no luck. Any idea ??

Thanks,
Eduardo.


mark florisson | 5 Dec 18:31 2011
Picon

Re: Unicode and numpy

On 5 December 2011 17:06, Eduardo Lenz <eduardobarplenz <at> gmail.com> wrote:
> Hi,
>
> after adding  #cython: language_level=3   in my .pxd files I got the
> following error messages
>
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
>                 # need to call releasebuffer
>                 info.obj = self
>
>             if not hasfields:
>                 t = descr.type_num
>                 if ((descr.byteorder == '>' and little_endian) or
>                                        ^
> ------------------------------------------------------------
>
> /usr/lib/python3.2/site-packages/Cython/Includes/numpy.pxd:254:40: Unicode
> literals do not support coercion to C types other than Py_UNICODE or
> Py_UCS4.
>
>
> I tried with stable and cython-git 20111205-1 versions, with no luck. Any
> idea ??
>
> Thanks,
> Eduardo.
>
>

Hm, that's certainly a bug. I don't think the language level from a
.pyx should affect the code in a cimported .pxd file. I suppose that
means you can't use the language_level directive if you want to use
numpy.pxd until this is resolved.


Gmane