New submission from Maximilian Hils <python-b...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue47014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to