[Python-checkins] cpython: Issue #23648: Document the PEP 475 in the "Porting to Python 3.5" section and

victor.stinner python-checkins at python.org
Thu Mar 26 23:51:05 CET 2015


https://hg.python.org/cpython/rev/b7c0137cccbe
changeset:   95212:b7c0137cccbe
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Mar 26 23:50:57 2015 +0100
summary:
  Issue #23648: Document the PEP 475 in the "Porting to Python 3.5" section and
add a version changed note in modified functions.

files:
  Doc/library/functions.rst |   5 +++++
  Doc/library/os.rst        |  20 ++++++++++++++++++++
  Doc/whatsnew/3.5.rst      |   8 ++++++++
  3 files changed, 33 insertions(+), 0 deletions(-)


diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1065,6 +1065,11 @@
 
       The ``'U'`` mode.
 
+   .. versionchanged:: 3.5
+      If the system call is interrupted and the signal does not raise an
+      exception, the function now retries the system call instead of raising an
+      :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
+
 
 .. function:: ord(c)
 
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -905,6 +905,11 @@
    .. versionadded:: 3.3
       The *dir_fd* argument.
 
+   .. versionchanged:: 3.5
+      If the system call is interrupted and the signal does not raise an
+      exception, the function now retries the system call instead of raising an
+      :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
+
 The following constants are options for the *flags* parameter to the
 :func:`~os.open` function.  They can be combined using the bitwise OR operator
 ``|``.  Some of them are not available on all platforms.  For descriptions of
@@ -1082,6 +1087,11 @@
       :func:`popen` or :func:`fdopen`, or :data:`sys.stdin`, use its
       :meth:`~file.read` or :meth:`~file.readline` methods.
 
+   .. versionchanged:: 3.5
+      If the system call is interrupted and the signal does not raise an
+      exception, the function now retries the system call instead of raising an
+      :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
+
 
 .. function:: sendfile(out, in, offset, nbytes)
               sendfile(out, in, offset, nbytes, headers=None, trailers=None, flags=0)
@@ -1197,6 +1207,11 @@
       :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its
       :meth:`~file.write` method.
 
+   .. versionchanged:: 3.5
+      If the system call is interrupted and the signal does not raise an
+      exception, the function now retries the system call instead of raising an
+      :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
+
 
 .. function:: writev(fd, buffers)
 
@@ -3359,6 +3374,11 @@
    id is known, not necessarily a child process. The :func:`spawn\* <spawnl>`
    functions called with :const:`P_NOWAIT` return suitable process handles.
 
+   .. versionchanged:: 3.5
+      If the system call is interrupted and the signal does not raise an
+      exception, the function now retries the system call instead of raising an
+      :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
+
 
 .. function:: wait3(options)
 
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -572,6 +572,14 @@
 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:
+
+  - :func:`os.open`, :func:`open`
+  - :func:`os.read`, :func:`os.write`
+  - :func:`time.sleep`
+
 * Before Python 3.5, a :class:`datetime.time` object was considered to be false
   if it represented midnight in UTC.  This behavior was considered obscure and
   error-prone and has been removed in Python 3.5.  See :issue:`13936` for full

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list