[placing this a bit more prominently]

Hi,

Gary Furnish wrote:
>> current cython-devel is all manner of broken against sage (unicode errors),
>> any idea when the hg repo will be working again?

hmm, interesting. I'm not aware of any problems, Cython's tests run just fine.
I just added a few more to make sure everything works as expected. What kind
of errors do you get?

My guess is that this is due to the PEP 3120 implementation. If you use 8-bit
strings in your sources, you must declare their encoding in the source header
(PEP 263). Otherwise, Cython will expect them to be UTF-8 encoded (PEP 3120),
and decode them on input. So anything but UTF-8 will (very likely) give you a
compiler error.

I don't know what encoding Sage commonly uses. After all, the most common
unicode bug is that people just don't care about encodings. In case it's
latin-1, you will have to add this at the beginning of the non-ASCII source 
files:

# -*- coding: latin-1 -*-

Alternatively, you can recode the source files from latin1 to UTF-8.

To figure out if a source file uses non-ASCII characters, you can do something
like this:

    import codecs
    codecs.open("thefile.pyx", encoding="ASCII").read()

You get an exception if it's not ASCII.

Stefan
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to