[Cython] Cython code producing different, incorrect results under Python 2.7 (not 3.x) under Cython 0.19

Josh Warner silvertrumpet999 at gmail.com
Wed Apr 24 08:06:36 CEST 2013


Hi Cython devs,

Over in scikit-image we have traced an odd problem with a particular Cython
file to the 0.19 update of Cython. From at least Cython 0.15.1 (probably
earlier) through 0.18, `_mcp.pyx` in `skimage.graph` compiled and executed
correctly, passing all package tests on both Python 2.7 and Python 3.

After 0.19 was released and the Travis builds began using it, we began
getting 100% repeatable errors from the previously clean master branch
(example of an otherwise clean Python
2.7<https://travis-ci.org/scikit-image/scikit-image/jobs/6545505>Travis
build; the
Python 3 build passed<https://travis-ci.org/scikit-image/scikit-image/builds/6545504>all
tests). All of these errors/failures trace back to this Cython file.
Oddly, the errors only happen on Python 2.7; our Python 3 Travis build
passes.

We are discussing this issue in scikit-image Github Issue
#534<https://github.com/scikit-image/scikit-image/issues/534>;
feel free to join the discussion there.

The .pyx Cython file is located
here<https://github.com/scikit-image/scikit-image/blob/master/skimage/graph/_mcp.pyx>and
it has
an associated .pxd file
here<https://github.com/scikit-image/scikit-image/blob/master/skimage/graph/_mcp.pxd>.
It should be noted the file compiles and executes without errors, but its
output is now incorrect in Python 2.x.

In case the compiled results might be relevant, for your diffing pleasure here
is the compiled .c file from Cython
0.18<https://gist.github.com/JDWarner/af4f8ea85dce356ce95c>which
passes all tests on both Python 2.7 and Python 3.x, while here
is the compiled .c file from Cython
0.19<https://gist.github.com/JDWarner/56d15b7a7527b8d4314e>which
produces different, incorrect results in Python 2.7.

In the short term we are temporarily forcing Travis to use the 0.18 release
of Cython, but that isn't a viable long term solution.

It's possible the error is on our end, but seeing as it worked with prior
Cython releases we'd appreciate you taking a look.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20130424/ee4b168d/attachment.html>


More information about the cython-devel mailing list