This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abusalimov
Recipients abusalimov, amaury.forgeotdarc, belopolsky, benjamin.peterson, ronaldoussoren, rupole
Date 2014-10-28.23:59:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1414540791.34.0.0323920989092.issue3453@psf.upfronthosting.co.za>
In-reply-to
Content
It is possible to get a partially initialized class from inside a custom mro(). And extending such type results in passing NULL to PySequence_List inside mro_implementation, which in turn leads to PyErr_BadInternalCall. #22735 has a test reproducing it (http://bugs.python.org/file37036) and a corresponding fix of mro_implementation (http://bugs.python.org/file37038).

However, I'm not sure that the proper way is to call PyType_Ready on each uninitialized class from tp_bases. In particular, the test case from the link above would end up with infinite recursion (PyType_Ready(cls) -> mro(cls) -> class X(cls): ... -> PyType_Ready(X) -> PyType_Ready(cls) -> ...). Moreover, whether a type is initialized or not is determized by checking its tp_dict, which is initialized before filling in tp_mro, so that may be the test above is not the case of Roger.
History
Date User Action Args
2014-10-28 23:59:51abusalimovsetrecipients: + abusalimov, ronaldoussoren, amaury.forgeotdarc, belopolsky, rupole, benjamin.peterson
2014-10-28 23:59:51abusalimovsetmessageid: <1414540791.34.0.0323920989092.issue3453@psf.upfronthosting.co.za>
2014-10-28 23:59:51abusalimovlinkissue3453 messages
2014-10-28 23:59:51abusalimovcreate