Ticket #19 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Cython annotation breaks on certain pointer casts

Reported by: Stefan van der Walt <stefan@…> Owned by: somebody
Priority: major Milestone: 0.10
Component: Parsing Keywords: annotate
Cc:

Description

When compiling the following text with cython -a, I get a UnicodeDecodeError?:

cdef extern from "Python.h":
    ctypedef int Py_intptr_t

print '  stride %d:' % <Py_intptr_t>3
Traceback (most recent call last):
  File "/Users/stefan/bin/cython", line 8, in <module>
    main(command_line = 1)
  File "/Users/stefan/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 342, in main
    result = context.compile(source, options)
  File "/Users/stefan/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 217, in compile
    tree.process_implementation(scope, options, result)
  File "/Users/stefan/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 51, in process_implementation
    self.generate_c_code(env, options, result)
  File "/Users/stefan/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 246, in generate_c_code
    code.save_annotation(result.c_file[:-1] + "pyx") # change?
  File "/Users/stefan/lib/python2.5/site-packages/Cython/Compiler/Annotate.py", line 78, in save_annotation
    lines[line_no] = line[:col] + item + line[col:]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 0: ordinal not in range(128)

I'm running 726:9527edc22cb6 from Jun 13 20:50:39 2008 +0200.

Change History

Changed 5 years ago by robertwb

  • milestone set to 0.9.8.2

Changed 5 years ago by anonymous

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.