[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-bugs-list
Subject:    [issue33192] asyncio should use signal.set_wakeup_fd on Windows
From:       Nathaniel Smith <report () bugs ! python ! org>
Date:       2018-03-31 22:44:55
Message-ID: 1522536295.45.0.467229070634.issue33192 () psf ! upfronthosting ! co ! za
[Download RAW message or body]


New submission from Nathaniel Smith <njs@pobox.com>:

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.

----------
messages: 314749
nosy: asvetlov, giampaolo.rodola, njs, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio should use signal.set_wakeup_fd on Windows
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue33192>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/python-bugs-list%40marc.info



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic