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 bfroehle
Recipients Arfrever, bfroehle, chris.jerdonek, christopherthemagnificent, kushal.das
Date 2012-10-29.21:01:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351544492.49.0.566969528386.issue16268@psf.upfronthosting.co.za>
In-reply-to
Content
This rather obscure bug seems to be caused by a failure to properly initialize PyCell_Type.

Running with GDB, we see that _PyType_Lookup(<class 'cell'>,  "__dir__") 
fails in:

    /* Look in tp_dict of types in MRO */
    mro = type->tp_mro;

    /* If mro is NULL, the type is either not yet initialized
       by PyType_Ready(), or already cleared by type_clear().
       Either way the safest thing to do is to return NULL. */
    if (mro == NULL)
        return NULL;

Since:

    (gdb) print PyCell_Type->tp_mro
    $9 = (PyObject *) 0x0

Searching the code base shows that we never call PyType_Ready(&PyCell_Type).

A patch is attached.
History
Date User Action Args
2012-10-29 21:01:32bfroehlesetrecipients: + bfroehle, Arfrever, christopherthemagnificent, chris.jerdonek, kushal.das
2012-10-29 21:01:32bfroehlesetmessageid: <1351544492.49.0.566969528386.issue16268@psf.upfronthosting.co.za>
2012-10-29 21:01:32bfroehlelinkissue16268 messages
2012-10-29 21:01:32bfroehlecreate