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 rabraham
Recipients asvetlov, rabraham, yselivanov
Date 2021-04-19.02:47:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org>
In-reply-to
Content
There doesn't appear to be a way to prematurely kill a subprocess using the high-level asyncio subprocess APIs (https://docs.python.org/3.9/library/asyncio-subprocess.html) without getting a traceback on exit.

On exit, the attached program writes the following to stderr:

$ python3.9 kill_subprocess.py

Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x1065f0dc0>
Traceback (most recent call last):
    ...
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

If I uncomment `# process._transport.close()` or comment `asyncio.sleep(1)`, the walkback disappears. (I get the same behavior in python 3.8. I haven't tried other python versions.)
History
Date User Action Args
2021-04-19 02:47:38rabrahamsetrecipients: + rabraham, asvetlov, yselivanov
2021-04-19 02:47:38rabrahamsetmessageid: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org>
2021-04-19 02:47:38rabrahamlinkissue43884 messages
2021-04-19 02:47:37rabrahamcreate