Message228994
BaseEventLoop.run_forever() creates a temporary task when it gets a coroutine object. If the coroutine raises a base exception, it is stored in the temporary task (task.set_exception(exc)). run_forever() doesn't catch the exception, which is the expected behaviour.
The problem is that the temporary task still holds the exception, whereas the caller doesn't have access to this temporary task object. As a result, a warning is logger.
I propose to simply drop the exception from the task object (consume it). The call will get it anyway, it's not catched.
Attached patch implements this idea with a unit test. |
|
Date |
User |
Action |
Args |
2014-10-10 12:07:33 | vstinner | set | recipients:
+ vstinner, gvanrossum, yselivanov |
2014-10-10 12:07:33 | vstinner | set | messageid: <1412942853.71.0.75284740546.issue22601@psf.upfronthosting.co.za> |
2014-10-10 12:07:33 | vstinner | link | issue22601 messages |
2014-10-10 12:07:33 | vstinner | create | |
|