New submission from hubo <hubo1...@126.com>:
The attachment is a script that demonstrates the behavior. The simple unittest
script should exit very quickly, but in fact, it runs indefinitely.
It uses asyncio to reproduce the result, but other concurrent technologies are
In Python 3, traceback of an exception is mutable. When the exception is
re-raised, current frames are appended to the traceback. But when the same
exception object is raised in multiple position (e.g. passed to different
coroutines with futures), the frames are appended in the same list, so the
tracebacks are mixed together.
assertRaises in unittest calls traceback.clear_frames internally. When the
tracebacks are mixed, it may clear a running frame (in a generator), producing
title: raise an exception from multiple positions break the traceback frames
versions: Python 3.6
Added file: https://bugs.python.org/file47480/test1.py
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list