On 12/07/2016 01:27 AM, François Bissey wrote: > On 07/12/16 12:20, than...@debian.org wrote: >> Hi sage-devel, >> >> we're almost ready to upload Sage to Debian (in fact we basically have >> to upload it this week to make sure it's included in the next Debian >> release). >> >> However, on Sunday python 2.7.13rc1 was uploaded to Debian and now we >> are facing a bug that I didn't quite manage to work around yet and that >> blocks any development at the moment. >> >> This happens whenever Unknown is imported, meaning during the docbuild >> and when starting sage: >> >> ... >> from sage.misc.unknown import Unknown >> File >> "<BUILDDIR>/usr/lib/python2.7/dist-packages/sage/misc/unknown.py", line >> 164, in <module> >> Unknown = UnknownClass() >> File "sage/misc/classcall_metaclass.pyx", line 330, in >> sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ >> (<CYTHONIZED>/sage/misc/classcall_metaclass.c:1413) >> File "sage/misc/cachefunc.pyx", line 1059, in >> sage.misc.cachefunc.CachedFunction.__call__ >> (<CYTHONIZED>/sage/misc/cachefunc.c:6080) >> File >> "<BUILDDIR>/usr/lib/python2.7/dist-packages/sage/structure/unique_representation.py", >> >> line 1022, in __classcall__ >> instance = typecall(cls, *args, **options) >> File "sage/misc/classcall_metaclass.pyx", line 497, in >> sage.misc.classcall_metaclass.typecall >> (<CYTHONIZED>/sage/misc/classcall_metaclass.c:1862) >> TypeError: sage.misc.fast_methods.WithEqualityById.__new__(UnknownClass) >> is not safe, use object.__new__() >> >> I'm pretty sure it's caused by the change of >> https://bugs.python.org/issue5322 >> which is included in python 2.7.13rc1. >> >> I hope you can help me to fix this, or at least provide a workaround. >> > > What did you try so far? > The most obvious thing to try, as far as I can see, is to add > __new__ = object.__new__() > before > def __init__(self): > in sage/misc/unknown.py > > Francois >
I created a minimal cython example with classes and cdef classes that inherit from each other in the same way as here to see if this is caused by WithEqualityById being a cdef class. In the example everything worked as it should. Just because it appears in the error message I also tried replacing the two (<PyTypeObject*>type).tp_call(cls, args, kwds) in sage/misc/classcall_metaclass.pyx by type.__call__(cls, *args, **kwds). That didn't help either. I'll try your suggestion next, thanks. Best, Tobias -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.