Adding the feature under PYTHONASYNCIODEBUG flag sounds perfectly reasonable for me. But not in production mode.
On Sat, Jul 30, 2016 at 6:08 PM Герасимов Михаил <gerasimov-...@yandex.ru> wrote: > > When you have `await task` line you probably know what task it is, you can > debug and fix it. > > But hanging on `loop.close()` because some unknown task hangs looks very > confusing. > The approach gives no clue for what task is malformed. > > Users will blame that `loop.close()` hangs forever without any reason or > additional information. > > > ok, regardless placing this code inside `loop.close()` is there any > alternative to sure async generators inside `main()` are closed? > > > loop.run_until_complete(main()) > > pending = asyncio.Task.all_tasks() > loop.run_until_complete(asyncio.gather(*pending)) > > loop.close() > > Currently, I just don't see any other way to use some async generator > (that needs some time to be closed) without getting warning. > > In case malformed generator is unwanted behaviour may be it'll be ok to > show warning in debug mode if some close task isn't finished after some > timeout? > -- Thanks, Andrew Svetlov
_______________________________________________ Async-sig mailing list Async-sig@python.org https://mail.python.org/mailman/listinfo/async-sig Code of Conduct: https://www.python.org/psf/codeofconduct/