cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Test test_asyncio prints quite a few ResourceWarnings for "unclosed event loop"

Open gvanrossum opened this issue 3 years ago • 1 comments

It's possible that this only happens when using --with-pydebug. (And perhaps only on Mac?)

I get 8 of these:

/Users/guido/cpython/Lib/asyncio/base_events.py:703: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
  _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

There's also this, once:

/Users/guido/cpython/Lib/test/test_asyncio/test_unix_events.py:1750: DeprecationWarning: 'get_child_watcher' is deprecated as of Python 3.12 and will be removed in Python 3.14.
  watcher = policy.get_child_watcher()

gvanrossum avatar Nov 10 '22 23:11 gvanrossum

I'll take care of the last one in https://github.com/python/cpython/pull/99386

kumaraditya303 avatar Nov 11 '22 17:11 kumaraditya303

Closing event loop was missed in test_uncancel_structured_blocks, I submitted a PR #99414 to fix this : )

xiaochen7 avatar Nov 12 '22 17:11 xiaochen7