This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author njs
Recipients asvetlov, giampaolo.rodola, njs, vstinner, yselivanov
Date 2018-03-31.22:44:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522536295.45.0.467229070634.issue33192@psf.upfronthosting.co.za>
In-reply-to
Content
I thought there was already a bug for this, but it came up in conversation again and I can't find one, so, here you go...

It looks like originally there was this bug for making control-C wake up the asyncio event loop in Windows: https://github.com/python/asyncio/issues/191

This required some changes to signal.set_wakeup_fd to work on Windows, which was done in bpo-22018.

But I guess the last step got lost in the shuffle: right now signal.set_wakeup_fd works fine on Windows, but asyncio doesn't actually use it. This means that on Windows you can't wake up this program using control-C:

>>> import asyncio
>>> asyncio.run(asyncio.sleep(100000000))

Both of the Windows event loops should register a wakeup socket with signal.set_wakeup_fd, and arrange for the loop to wake up when data arrives on that socket, and read from it until it's empty again. (And once the loop is awake, Python's normal control-C handling will kick in.) That will make control-C on Windows work similarly to how it does on Unix.
History
Date User Action Args
2018-03-31 22:44:55njssetrecipients: + njs, vstinner, giampaolo.rodola, asvetlov, yselivanov
2018-03-31 22:44:55njssetmessageid: <1522536295.45.0.467229070634.issue33192@psf.upfronthosting.co.za>
2018-03-31 22:44:55njslinkissue33192 messages
2018-03-31 22:44:55njscreate