STINNER Victor <victor.stin...@haypocalc.com> added the comment:

Extract of manpage signal(7):

"The  following  interfaces  are never restarted after being interrupted by a 
signal handler, regardless of the use of SA_RESTART; they always fail with the 
error EINTR when interrupted by a signal handler:
 * ...
 * File descriptor multiplexing interfaces: epoll_wait(2), epoll_pwait(2), 
poll(2), ppoll(2), select(2), and pselect(2)."

Consider siginterrupt(signal, False) as a "best-effort" trick... which doesn't 
work with select().

If you don't want select() to be interrupted by SIGINT, use:

pthread_sigmask(SIG_BLOCK, [SIGINT]);
select(...)
pthread_sigmask(SIG_UNBLOCK, [SIGINT])

or

pselect(...., [SIGINT])

pselect() is atomic, whereas pthread_sigmask+select is not.

I added recently pthread_sigmask() to the signal module in Python 3.3.

pselect() is not exposed in Python currently. We may add it if it's needed.

--

If you really don't care of SIGINT, you can also ignore it completly using 
signal(SIGINT, SIG_IGN).

----------
nosy: +haypo

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

Reply via email to