STINNER Victor added the comment:

I commited my patch to support sockets in signal.set_wakeup_fd() on Windows.

I updated my patch. It doesn't change signal.set_wakeup_fd() on Windows 
anymore. It only raises an exception on POSIX if the file descriptor is 
blocking.

On Windows, it's not possible to make a file non-blocking and so the signal 
handler may block on writing in the file. Antoine Pitrou doesn't want to change 
the behaviour, he prefers to still support files even if there is the possible 
hang.

On Windows, it's not possible to check if a socket handle is blocking or not. 
So set_wakeup_fd() doesn't check if the socket is blocking or not on Windows.

At least, the check can be implemented on POSIX.

--

An alternative is to make the file descriptor non-blocking in set_wakeup_fd(). 
In this case, I suggest to drop support of files on Windows because files 
cannot be set in non-blocking mode.

----------
Added file: http://bugs.python.org/file36156/signal_check_nonblocking-2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22042>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to