[issue33192] asyncio should use signal.set_wakeup_fd on Windows

2018-04-01 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
components: +Library (Lib)
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33192] asyncio should use signal.set_wakeup_fd on Windows

2018-03-31 Thread Nathaniel Smith

New submission from Nathaniel Smith :

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(1))

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com