Issue 12475: Generator bug allows you to chain arbitrary tracebacks to the next raised exception (original) (raw)

It's probably best shown by example:

http://ideone.com/4YkqV

Have fun! This one looks hard.

Some notes: Exchanging g2() for iter([1]) makes this go away. Wrapping g2 inside a non-generator iterator does not make this go away.

Removing the call to next(it) after it = g2() makes the problem go away, as does replacing those two lines with next(g2()).

The file used in that ideone paste is attached for your convenience.


Debugging is impractical for me with this bug in existence. It never stopped printing the traceback before I killed the process. (And let's forget about debug prints!)