[New-bugs-announce] [issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop

Maximilian Hils report at bugs.python.org
Mon Mar 14 13:14:48 EDT 2022


New submission from Maximilian Hils <python-bugs at maximilianhils.com>:

When a (second) ProactorEventLoop is garbage-collected, the current ProactorEventLoop starts to ignore Ctrl+C on Windows until it is woken up. The attached repro shows a minimal example. Uncommenting the `create_task` call or not using a second event loop fixes the behavior.

I couldn't find any shared/global objects in asyncio/windows_events.py, so I'm not sure what is causing this, or why the wakeup task helps.

FWIW, the second event loop in our code base originated from a stray `get_event_loop()` call, one more example that speaks in favor of `get_running_loop()`!

----------
components: asyncio
files: proactor-repro.py
messages: 415169
nosy: asvetlov, mhils, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop ignores Ctrl+C after closing unrelated loop
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50675/proactor-repro.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47014>
_______________________________________


More information about the New-bugs-announce mailing list