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 serhiy.storchaka
Recipients eric.snow, rhettinger, serhiy.storchaka, vstinner
Date 2015-09-03.13:57:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If don't initialize fields, then they will be not initialized in odict_dealloc, odict_tp_clear and odict_traverse. But _odict_FIRST(od) and od->od_weakreflist are used in these functions.

I would allocate a dict for od_inst_dict before calling PyDict_Type.tp_new. An allocator can release GIL and call Python code, and at that moment the OrderedDict object is in inconsistent state. I already were fell in similar trap with lru_cache (issue14373, msg246573).
Date User Action Args
2015-09-03 13:57:28serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, eric.snow
2015-09-03 13:57:28serhiy.storchakasetmessageid: <>
2015-09-03 13:57:28serhiy.storchakalinkissue24992 messages
2015-09-03 13:57:28serhiy.storchakacreate