compiler traceback related to unicode

21 views
Skip to first unread message

Andreas van Cranenburgh

unread,
Oct 31, 2012, 5:20:27 PM10/31/12
to cython...@googlegroups.com
Cython 0.17.1 gives me a traceback related to unicode:

  File "Code.py", line 1426, in Cython.Compiler.Code.CCodeWriter.intern_identifier (/datastore/acranenb/disco-dop/build/cython/Cython/Compiler/Code.c:29885)
  File "Code.py", line 1416, in Cython.Compiler.Code.CCodeWriter.get_py_string_const (/datastore/acranenb/disco-dop/build/cython/Cython/Compiler/Code.c:29530)
  File "Code.py", line 1002, in Cython.Compiler.Code.GlobalState.get_py_string_const (/datastore/acranenb/disco-dop/build/cython/Cython/Compiler/Code.c:21136)
  File "Code.py", line 982, in Cython.Compiler.Code.GlobalState.get_string_const (/datastore/acranenb/disco-dop/build/cython/Cython/Compiler/Code.c:20658)
AttributeError: 'unicode' object has no attribute 'is_unicode'

This is strange, because I don't think my code uses unicode at all. The property is_unicode exists in Code.pxd but only in a commented section.

Robert Bradshaw

unread,
Oct 31, 2012, 5:52:02 PM10/31/12
to cython...@googlegroups.com
On Wed, Oct 31, 2012 at 2:20 PM, Andreas van Cranenburgh
<and...@unstable.nl> wrote:
> Cython 0.17.1 gives me a traceback related to unicode:

This does look like a bug on our end. Could you give the files and
command you used in compiling that gave you this error?

Andreas van Cranenburgh

unread,
Oct 31, 2012, 9:04:26 PM10/31/12
to cython...@googlegroups.com

I found what triggered the crash: a spurious comma.
Here's a test case to reproduce it:

# gives proper error message:
#def foo(short, x): pass

# gives no error message:
cdef bar(short, x): pass

# compiler crash:
cpdef zed(short, x): pass

Robert Bradshaw

unread,
Nov 1, 2012, 2:02:52 AM11/1/12
to cython...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages