[issue38284] signal.sigwait* do not intercept certain signals

2019-10-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Closing as not a Python bug.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38284] signal.sigwait* do not intercept certain signals

2019-10-04 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Python just exposes thin wrappers around the underlying libc calls, so you have 
to understand how those work.

On Linux, the sigwaitinfo() man page says:

NOTES
   In normal usage, the calling program blocks the signals  in
   set via a prior call to sigprocmask(2) (so that the default
   disposition for these signals does not occur if they become
   pending  between  successive calls to sigwaitinfo() or sig‐
   timedwait()) and does not establish handlers for these sig‐
   nals.

So you need to block the given signal with pthread_sigmask() before waiting on 
it.  For example:

>>> import signal
>>> signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGHUP])
set()
>>> signal.sigwait([signal.SIGHUP])


--
nosy: +pitrou

___
Python tracker 

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



[issue38284] signal.sigwait* do not intercept certain signals

2019-09-26 Thread Blindfreddy


New submission from Blindfreddy :

On debian, signal.sigwait/sigwaitinfo/sigtimedwait do not properly handle the 
below signals (NOK).

Steps to reproduce

1. start python and type:
>>> import signal
>>> signal.sigwait([

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