Cython failure

Issue #3 resolved
Yusuke Sakamoto created an issue

When I try to build slepc4py, I get the following error:

Error compiling Cython file:
    return s

cdef inline str S_(const_char p[]):
     if p == NULL: return None
     cdef bytes s = <char*>p
     return s if isinstance(str(s), str) else s.decode()
             ^
SLEPc/SLEPc.pyx:45:14: Cannot convert 'bytes' object to str implicitly. This is not portable to Py3.
error: Cython failure: 'slepc4py.SLEPc.pyx' -> 'slepc4py.SLEPc.c'

As the error says, if I change the part to

return str(s) if isinstance(str(s), str) else s.decode()

I can successfully build it although I am not sure if this is the right thing to do.

I use Cython version 0.20.1 and Python 2.7.5 on MacOSX 10.9.1.

Comments (4)

  1. Log in to comment