summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-21 08:49:56 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-02-21 08:49:56 (GMT)
commitd9108d1253eef9f43c60e0ed5f1ec5603c1fba6c (patch)
treeaa46f7db962e856b6a9fbc2845972ceaccfcf8eb /Doc
parent86a8be00ed5266550a3d97a3c065f7a22018b6a6 (diff)
downloadcpython-d9108d1253eef9f43c60e0ed5f1ec5603c1fba6c.zip
cpython-d9108d1253eef9f43c60e0ed5f1ec5603c1fba6c.tar.gz
cpython-d9108d1253eef9f43c60e0ed5f1ec5603c1fba6c.tar.bz2
Issue #23430: Stop socketserver from catching SystemExit etc from handlers
Also make handle_error() consistently output to stderr, and fix the documentation.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/socketserver.rst6
-rw-r--r--Doc/whatsnew/3.6.rst11
2 files changed, 15 insertions, 2 deletions
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
index f0cfc80..aaaa61e 100644
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -304,7 +304,11 @@ Server Objects
This function is called if the :meth:`~BaseRequestHandler.handle`
method of a :attr:`RequestHandlerClass` instance raises
an exception. The default action is to print the traceback to
- standard output and continue handling further requests.
+ standard error and continue handling further requests.
+
+ .. versionchanged:: 3.6
+ Now only called for exceptions derived from the :exc:`Exception`
+ class.
.. method:: handle_timeout()
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index 8b879de..5c02b7d 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -334,7 +334,16 @@ Changes in the Python API
* When a relative import is performed and no parent package is known, then
:exc:`ImportError` will be raised. Previously, :exc:`SystemError` could be
- raised. (Contribute by Brett Cannon in :issue:`18018`.)
+ raised. (Contributed by Brett Cannon in :issue:`18018`.)
+
+* Servers based on the :mod:`socketserver` module, including those
+ defined in :mod:`http.server`, :mod:`xmlrpc.server` and
+ :mod:`wsgiref.simple_server`, now only catch exceptions derived
+ from :exc:`Exception`. Therefore if a request handler raises
+ an exception like :exc:`SystemExit` or :exc:`KeyboardInterrupt`,
+ :meth:`~socketserver.BaseServer.handle_error` is no longer called, and
+ the exception will stop a single-threaded server. (Contributed by
+ Martin Panter in :issue:`23430`.)
Changes in the C API