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 asvetlov
Recipients asvetlov, yselivanov
Date 2019-01-24.00:58:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548291532.01.0.358121522852.issue35812@roundup.psfhosted.org>
In-reply-to
Content
We use `asyncio.run()` (well, a backported to python3.6 private copy) in our application.

The problem is: when `asyncio.run(main_coro(args))` raises an exception it is both raised to a caller and passed to `loop.call_exception_handler()` by `_cancel_all_tasks()` as *unhandled exception*.

I believe that the logging of unhandled exceptions is a very useful feature but the logging should be skipped for the main coroutine passed to `asyncio.run()` because it is handled by outer code anyway.

The fix is trivial, the attached file shows how to do it.
But the fix needs tests also.

If somebody wishes to pick up the issue and make it done -- it would be awesome. I will help with review and commit, sure.

Another question is should the changing land into 3.7?
I think yes but feedback from Yuri Selivanov is very welcome.
History
Date User Action Args
2019-01-24 00:58:55asvetlovsetrecipients: + asvetlov, yselivanov
2019-01-24 00:58:52asvetlovsetmessageid: <1548291532.01.0.358121522852.issue35812@roundup.psfhosted.org>
2019-01-24 00:58:51asvetlovlinkissue35812 messages
2019-01-24 00:58:51asvetlovcreate