This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Blindfreddy, pitrou
Date 2019-10-04.12:43:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570193031.64.0.105866218895.issue38284@roundup.psfhosted.org>
In-reply-to
Content
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])
<Signals.SIGHUP: 1>
History
Date User Action Args
2019-10-04 12:43:51pitrousetrecipients: + pitrou, Blindfreddy
2019-10-04 12:43:51pitrousetmessageid: <1570193031.64.0.105866218895.issue38284@roundup.psfhosted.org>
2019-10-04 12:43:51pitroulinkissue38284 messages
2019-10-04 12:43:51pitroucreate