You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-03-20.12:10:39.245>created_at=<Date2015-03-20.01:13:29.026>labels= []
title='PEP 475: handle EINTR in the signal module'updated_at=<Date2015-03-27.13:36:01.527>user='https://github.com/vstinner'
changed the title [-]PEP 475: signal.sigtimedwait() must retry if sigtimedwait() failed with EINTR[/-][+]PEP 475: handle EINTR in the signal module[/+]on Mar 20, 2015
signal_eintr.py: More complete patch, modify also signal.sigwaitinfo().
--
I don't think that other signal functions need to be modified to handle EINTR.
POSIX manual pages:
"The pthread_sigmask() function shall not return an error code of [EINTR]."
"The pthread_kill() function shall not return an error code of [EINTR]."
pause() fails with EINTR when it receives a signal, but signal.pause() doesn't raise InterruptedError in this case, it only returns None, because we expect a signal.
I tested: signal.sigwait([]) doesn't fail with EINTR with a signal is received. No need to modify this function.
On Linux, signal.set_wakeup_fd() doesn't fail with InterruptedError.
Activity
vstinner commentedon Mar 20, 2015
Attached patch changes signal.sigtimedwait() to retry if sigtimedwait() failed with EINTR and the signal handler didn't raise an exception.
vstinner commentedon Mar 20, 2015
It looks like signal.sigwaitinfo() can also fail with InterruptedError. It should also be modified.
[-]PEP 475: signal.sigtimedwait() must retry if sigtimedwait() failed with EINTR[/-][+]PEP 475: handle EINTR in the signal module[/+]vstinner commentedon Mar 20, 2015
signal_eintr.py: More complete patch, modify also signal.sigwaitinfo().
--
I don't think that other signal functions need to be modified to handle EINTR.
POSIX manual pages:
pause() fails with EINTR when it receives a signal, but signal.pause() doesn't raise InterruptedError in this case, it only returns None, because we expect a signal.
I tested: signal.sigwait([]) doesn't fail with EINTR with a signal is received. No need to modify this function.
On Linux, signal.set_wakeup_fd() doesn't fail with InterruptedError.
python-dev commentedon Mar 20, 2015
New changeset 33a6e2587aad by Victor Stinner in branch 'default':
Issue bpo-23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried
https://hg.python.org/cpython/rev/33a6e2587aad
python-dev commentedon Mar 20, 2015
New changeset 8f9925a02fe7 by Victor Stinner in branch 'default':
Issue bpo-23715: Enhance test.script_helper to investigate test_eintr failure
https://hg.python.org/cpython/rev/8f9925a02fe7
python-dev commentedon Mar 20, 2015
New changeset 79aed09a9fa5 by Victor Stinner in branch 'default':
Issue bpo-23715: Fix test_eintr, skip tests on signal.sigwaitinfo() and
https://hg.python.org/cpython/rev/79aed09a9fa5
python-dev commentedon Mar 20, 2015
New changeset ed8c2a4a6d3d by Victor Stinner in branch 'default':
Issue bpo-23715: Fix test_script_helper
https://hg.python.org/cpython/rev/ed8c2a4a6d3d
python-dev commentedon Mar 27, 2015
New changeset 35bc15fa4930 by Victor Stinner in branch 'default':
Issue bpo-23715: Fix test_sigtimedwait() of test_eintr
https://hg.python.org/cpython/rev/35bc15fa4930