summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-05-24 01:14:44 (GMT)
committerGitHub <noreply@github.com>2018-05-24 01:14:44 (GMT)
commit453bd0bc65b7ea6a18c43da69143ab10d54c0a35 (patch)
tree6c3c61b643d1b80dfa63508e3b8de265ee4c40ab /Doc
parentb97de3dd86046ac46567146d86a69d4f78ea09db (diff)
downloadcpython-453bd0bc65b7ea6a18c43da69143ab10d54c0a35.zip
cpython-453bd0bc65b7ea6a18c43da69143ab10d54c0a35.tar.gz
cpython-453bd0bc65b7ea6a18c43da69143ab10d54c0a35.tar.bz2
bpo-33540: Add block_on_close attr to socketserver (GH-6911)
Add a new block_on_close class attribute to ForkingMixIn and ThreadingMixIn classes of socketserver to opt-in for pre-3.7 behaviour.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/socketserver.rst9
-rw-r--r--Doc/whatsnew/3.7.rst27
2 files changed, 30 insertions, 6 deletions
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
index 5600027..1b3062d 100644
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -116,10 +116,13 @@ server classes.
only available on POSIX platforms that support :func:`~os.fork`.
:meth:`socketserver.ForkingMixIn.server_close` waits until all child
- processes complete.
+ processes complete, except if
+ :attr:`socketserver.ForkingMixIn.block_on_close` attribute is false.
:meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon
- threads complete. Use daemonic threads by setting
+ threads complete, except if
+ :attr:`socketserver.ThreadingMixIn.block_on_close` attribute is false. Use
+ daemonic threads by setting
:data:`ThreadingMixIn.daemon_threads` to ``True`` to not wait until threads
complete.
@@ -128,6 +131,8 @@ server classes.
:meth:`socketserver.ForkingMixIn.server_close` and
:meth:`socketserver.ThreadingMixIn.server_close` now waits until all
child processes and non-daemonic threads complete.
+ Add a new :attr:`socketserver.ForkingMixIn.block_on_close` class
+ attribute to opt-in for the pre-3.7 behaviour.
.. class:: ForkingTCPServer
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index 46015af..b466e74 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -1216,6 +1216,18 @@ by default.
(Contributed by Christian Heimes in :issue:`28134`.)
+socketserver
+------------
+
+:meth:`socketserver.ThreadingMixIn.server_close` now waits until all non-daemon
+threads complete. :meth:`socketserver.ForkingMixIn.server_close` now waits
+until all child processes complete.
+
+Add a new :attr:`socketserver.ForkingMixIn.block_on_close` class attribute to
+:class:`socketserver.ForkingMixIn` and :class:`socketserver.ThreadingMixIn`
+classes. Set the class attribute to ``False`` to get the pre-3.7 behaviour.
+
+
sqlite3
-------
@@ -2156,10 +2168,17 @@ Changes in the Python API
and module are affected by this change. (Contributed by INADA Naoki and
Eugene Toder in :issue:`29463`.)
-* :meth:`~socketserver.BaseServer.server_close` in
- :class:`socketserver.ThreadingMixIn` and :class:`socketserver.ForkingMixIn`
- now waits until all non-daemon threads complete.
- (Contributed by Victor Stinner in :issue:`31233` and :issue:`31151`.)
+* :meth:`socketserver.ThreadingMixIn.server_close` now waits until all
+ non-daemon threads complete. Set the new
+ :attr:`socketserver.ThreadingMixIn.block_on_close` class attribute to
+ ``False`` to get the pre-3.7 behaviour.
+ (Contributed by Victor Stinner in :issue:`31233` and :issue:`33540`.)
+
+* :meth:`socketserver.ForkingMixIn.server_close` now waits until all
+ child processes complete. Set the new
+ :attr:`socketserver.ForkingMixIn.block_on_close` class attribute to ``False``
+ to get the pre-3.7 behaviour.
+ (Contributed by Victor Stinner in :issue:`31151` and :issue:`33540`.)
* The :func:`locale.localeconv` function now temporarily sets the ``LC_CTYPE``
locale to the value of ``LC_NUMERIC`` in some cases.