summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/errno.rst5
-rw-r--r--Doc/library/exceptions.rst7
-rw-r--r--Doc/library/select.rst7
-rw-r--r--Doc/whatsnew/3.5.rst14
4 files changed, 25 insertions, 8 deletions
diff --git a/Doc/library/errno.rst b/Doc/library/errno.rst
index d2163b6..22a5cbc 100644
--- a/Doc/library/errno.rst
+++ b/Doc/library/errno.rst
@@ -41,7 +41,10 @@ defined by the module. The specific list of defined symbols is available as
.. data:: EINTR
- Interrupted system call
+ Interrupted system call.
+
+ .. seealso::
+ This error is mapped to the exception :exc:`InterruptedError`.
.. data:: EIO
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 271a5c8..bddd0ed 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -536,7 +536,12 @@ depending on the system error code.
.. exception:: InterruptedError
Raised when a system call is interrupted by an incoming signal.
- Corresponds to :c:data:`errno` ``EINTR``.
+ Corresponds to :c:data:`errno` :py:data:`~errno.EINTR`.
+
+ .. versionchanged:: 3.5
+ Python now retries system calls when a syscall is interrupted by a
+ signal, except if the signal handler raises an exception (see :pep:`475`
+ for the rationale), instead of raising :exc:`InterruptedError`.
.. exception:: IsADirectoryError
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index 5334af8..7fe09cb 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -145,6 +145,13 @@ The module defines the following:
library, and does not handle file descriptors that don't originate from
WinSock.
+ .. versionchanged:: 3.5
+ The function is now retried with a recomputed timeout when interrupted by
+ a signal, except if the signal handler raises an exception (see
+ :pep:`475` for the rationale), instead of raising
+ :exc:`InterruptedError`.
+
+
.. attribute:: PIPE_BUF
The minimum number of bytes which can be written without blocking to a pipe
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
index d33dfe8..3f70a94 100644
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -173,9 +173,10 @@ PEP and implementation written by Ben Hoyt with the help of Victor Stinner.
PEP 475: Retry system calls failing with EINTR
----------------------------------------------
-:pep:`475` adds support for automatic retry of system calls failing with EINTR:
-this means that user code doesn't have to deal with EINTR or InterruptedError
-manually, and should make it more robust against asynchronous signal reception.
+:pep:`475` adds support for automatic retry of system calls failing with
+:py:data:`~errno.EINTR`: this means that user code doesn't have to deal with
+EINTR or :exc:`InterruptedError` manually, and should make it more robust
+against asynchronous signal reception.
.. seealso::
@@ -614,12 +615,13 @@ that may require changes to your code.
Changes in the Python API
-------------------------
-* :pep:`475`: the following functions are now retried when interrupted instead
- of raising :exc:`InterruptedError` if the signal handler does not raise
- an exception:
+* :pep:`475`: Examples of functions which are now retried when interrupted
+ instead of raising :exc:`InterruptedError` if the signal handler does not
+ raise an exception:
- :func:`os.open`, :func:`open`
- :func:`os.read`, :func:`os.write`
+ - :func:`select.select`
- :func:`time.sleep`
* Before Python 3.5, a :class:`datetime.time` object was considered to be false