Author hubo1016
Recipients hubo1016
Date 2018-03-13.09:19:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520932782.62.0.467229070634.issue33066@psf.upfronthosting.co.za>
In-reply-to
Content
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 also affected.

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 strange behaviors.
History
Date User Action Args
2018-03-13 09:19:42hubo1016setrecipients: + hubo1016
2018-03-13 09:19:42hubo1016setmessageid: <1520932782.62.0.467229070634.issue33066@psf.upfronthosting.co.za>
2018-03-13 09:19:42hubo1016linkissue33066 messages
2018-03-13 09:19:42hubo1016create