python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.04k stars 177 forks source link

SIGINT is not correctly handled in Windows #407

Open stefanotorresi opened 8 years ago

stefanotorresi commented 8 years ago

in Windows, CTRL+C doesn't terminate this script:

#!/usr/bin/env python

import asyncio

try:
    asyncio.get_event_loop().run_forever()
except KeyboardInterrupt:
    asyncio.get_event_loop().stop()

also see #191

lukkm commented 7 years ago

Are there any news or known workarounds for this? I'm having the same problem

gera2ld commented 7 years ago

@lukkm Here is a workaround: https://stackoverflow.com/questions/24774980/why-cant-i-catch-sigint-when-asyncio-event-loop-is-running/24775107#24775107