This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients gvanrossum, vstinner, yselivanov
Date 2014-10-10.12:07:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412942853.71.0.75284740546.issue22601@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-10-10 12:07:33vstinnersetrecipients: + vstinner, gvanrossum, yselivanov
2014-10-10 12:07:33vstinnersetmessageid: <1412942853.71.0.75284740546.issue22601@psf.upfronthosting.co.za>
2014-10-10 12:07:33vstinnerlinkissue22601 messages
2014-10-10 12:07:33vstinnercreate