Serhiy Storchaka added the comment:

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.

----------
stage:  -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29800>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to