An asyncio example

Terry Reedy tjreedy at
Sat Jul 4 22:22:41 CEST 2015

On 7/4/2015 3:04 AM, Adam Bartoš wrote:

> This is a minimal example:
> import asyncio
> async def wait():
>      await asyncio.sleep(5)
> loop = asyncio.get_event_loop()
> loop.run_until_complete(wait())
> Ctrl-C doesn't interrupt the waiting, instead KeyboardInterrupt occurs
> after those five seconds. It's 3.5.0b2 on Windows. Is it a bug?

I asked on pydev list and was pointed to
(where treated as missing feature ).  It is desired that this stop 
immediately on Windows as on Unix.

I suggest you post your minimal example there.  User interest in an 
issue being fixed and willingness to test patches can help motivate.

Even more minimal:

import asyncio
loop = asyncio.get_event_loop()

also not interruptible,

Terry Jan Reedy

More information about the Python-list mailing list