[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-18 Thread xloem


Change by xloem <0xl...@gmail.com>:


--
resolution: wont fix -> out of date

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-18 Thread xloem


Change by xloem <0xl...@gmail.com>:


--
resolution: out of date -> wont fix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-18 Thread xloem


xloem <0xl...@gmail.com> added the comment:

hey, I don't have the capacity to stay on this, but thanks for the attention, 
time, and clear response.

there are of course other situations such as returning a resource to library 
code or manual loop management, but I don't have the use case present any more.

maybe an aatexit library could patch this in if needed.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

asyncio.run() present since Python 3.7
After the main coroutine finish, it cancels all background tasks and waits for 
their termination.

Background tasks can use old good `try/finally` for resources cleanup.
An additional API is not required IMHO.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread xloem


xloem <0xl...@gmail.com> added the comment:

I'm sorry, is this closure an error? Could you explain more how to use 
asyncio.run() to clean up resources when an unhandled exception is thrown? Is 
this new with a recent python improvement?

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

asyncio.run() does the task

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42838] Wait for cleanup coroutines before event loop is closed.

2021-01-06 Thread xloem


New submission from xloem <0xl...@gmail.com>:

To handle destruction of resources especially during exceptions, it would be 
nice if there were some way to provide coroutines/tasks that run at the 
termination or closure of an event loop.  There are a lot of api options here.  
Maybe a simple one would be to have close() call a run_until_closed() function 
that starts all of these and steps the loop to wait for them, before closing, 
and provide run_close() functions to queue them for delay.

--
components: asyncio
messages: 384503
nosy: asvetlov, xloem, yselivanov
priority: normal
severity: normal
status: open
title: Wait for cleanup coroutines before event loop is closed.
type: enhancement
versions: Python 3.10, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com