[New-bugs-announce] [issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

Zhibin Dong report at bugs.python.org
Thu Feb 13 02:09:49 EST 2020

New submission from Zhibin Dong <developerdong at gmail.com>:

As shown in the code, when 0 is passed to asyncio.sleep function, sometimes the program does not exit when I press <Ctrl-C>. I must press <Ctrl-C> again to close the program. However, when a number, such as 0.01, which is bigger than 0, is passed to the sleep function, the program will exit as expected when I press <Ctrl-C> just once.

Is there any bug or just a wrong way to use? Thanks.

components: asyncio
files: SleepTest.py
messages: 361939
nosy: Zhibin Dong, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: KeyboardInterrupt is ignored when await asyncio.sleep(0)
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48893/SleepTest.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list