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 MSeifert, josh.r, lukasz.langa, serhiy.storchaka
Date 2017-03-14.05:55:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489470940.31.0.657710212152.issue29800@psf.upfronthosting.co.za>
In-reply-to
Content
It would be nice if you provided the solution with %S. But if you don't do this, and nobody other provide other pull request, I'll merge the current solution.

When the dictionary keys are changed during iteration PyDict_Next() can skip some key-value pairs or return some key-value pairs multiple times. It never raises an exception, crashes or hangs in infinite loop. This is appropriate.

The problem is that after calling __str__ for the key, the borrowed reference to the value can become invalid, and __repr__ will be called for destroyed object. This can cause an undefined behavior, in particular a crash.
History
Date User Action Args
2017-03-14 05:55:40serhiy.storchakasetrecipients: + serhiy.storchaka, lukasz.langa, josh.r, MSeifert
2017-03-14 05:55:40serhiy.storchakasetmessageid: <1489470940.31.0.657710212152.issue29800@psf.upfronthosting.co.za>
2017-03-14 05:55:40serhiy.storchakalinkissue29800 messages
2017-03-14 05:55:39serhiy.storchakacreate