[Cython] Bug: _PyType_Lookup shortcut in Cython 0.20 breaks lookup of __exit__ in Python 2.6

Wouter Bolsterlee uws at xs4all.nl
Sun Feb 2 18:43:06 CET 2014


Hi,

Thanks for the quick follow-up. See inline comments below.

Stefan Behnel schreef op zo 02-02-2014 om 18:13 [+0100]:
> Ok, I don't know what the exact difference is, but I do believe you
> that
> Py2.6 doesn't play as nicely here as Py3. In any case, the CPython
> code
> that I adapted it from didn't actually exist in Py2.6/3.1, so the
> guarantees don't need to be there either.

I didn't really look into this, so you may be right here.

> Given that this is essentially an optimisation (and otherwise meant to
> *improve* the compatibility with CPython's own behaviour), I'll
> disable
> this in Py2.6 and Py3.1 for the next bug fix release.
> 
> https://github.com/cython/cython/commit/b8e37bc15373f303691de2d256ad99045221c9e0
> 
> It would be good if you could come up with a failing regression test
> case
> for this, so that we can make sure it actually keeps working in the
> future.

I'm not familiar with the Cython codebase at all, so this might be a bit
too hard for me. However, I did manage to produce a minimal example that
triggers the issue at hand. I've put up the relevant files here:

  https://gist.github.com/wbolster/8771899

Hopefully you'll be able to construct a test from this.

    — Wouter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20140202/1573266d/attachment.sig>


More information about the cython-devel mailing list