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 mrabarnett
Recipients Arfrever, Jim.Jewett, alex, asvetlov, benjamin.peterson, eric.araujo, eric.smith, eric.snow, ezio.melotti, flox, gregory.p.smith, introom, josh.r, mrabarnett, ncoghlan, ned.deily, pitrou, refi64, rhettinger, scoder, serhiy.storchaka, tonn81, westurner, yselivanov
Date 2015-05-24.22:03:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432505029.79.0.553966520901.issue16991@psf.upfronthosting.co.za>
In-reply-to
Content
First some background: when you put a new entry into a dict, it looks for an empty slot, the key's hash determining the initial choice, but if that slot's occupied, it picks another, etc, so the key might not be in the slot of first choice.

In "PyODict_DelItem", it deletes the key from the dict and then calls "_odict_clear_node" to delete the node.

If the key that it's looking for wasn't in the slot of first choice, but that slot is empty, that'll be the one it'll return, ie, the wrong one.

The solution, therefore, is to delete the node _before_ deleting the key from the dict.

When I tried that, the test ran to completion.
History
Date User Action Args
2015-05-24 22:03:49mrabarnettsetrecipients: + mrabarnett, rhettinger, gregory.p.smith, ncoghlan, pitrou, scoder, eric.smith, benjamin.peterson, ned.deily, ezio.melotti, eric.araujo, Arfrever, alex, asvetlov, flox, eric.snow, Jim.Jewett, serhiy.storchaka, yselivanov, westurner, refi64, josh.r, tonn81, introom
2015-05-24 22:03:49mrabarnettsetmessageid: <1432505029.79.0.553966520901.issue16991@psf.upfronthosting.co.za>
2015-05-24 22:03:49mrabarnettlinkissue16991 messages
2015-05-24 22:03:49mrabarnettcreate