[Python-checkins] cpython (merge 3.3 -> default): Merge with 3.3

kristjan.jonsson python-checkins at python.org
Wed Dec 26 16:30:31 CET 2012


http://hg.python.org/cpython/rev/2d1cfbaef9a2
changeset:   81068:2d1cfbaef9a2
parent:      81065:cc3f7ef1072e
parent:      81067:7734c3020a47
user:        Kristján Valur Jónsson <kristjan at ccpgames.com>
date:        Wed Dec 26 15:15:17 2012 +0000
summary:
  Merge with 3.3
Issue #14574: Ignore socket errors raised when flushing a connection on close.

files:
  Doc/library/socketserver.rst |  4 ++--
  Lib/socketserver.py          |  7 ++++++-
  2 files changed, 8 insertions(+), 3 deletions(-)


diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -313,8 +313,8 @@
 .. method:: RequestHandler.finish()
 
    Called after the :meth:`handle` method to perform any clean-up actions
-   required.  The default implementation does nothing.  If :meth:`setup` or
-   :meth:`handle` raise an exception, this function will not be called.
+   required.  The default implementation does nothing.  If :meth:`setup`
+   raises an exception, this function will not be called.
 
 
 .. method:: RequestHandler.handle()
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -718,7 +718,12 @@
 
     def finish(self):
         if not self.wfile.closed:
-            self.wfile.flush()
+            try:
+                self.wfile.flush()
+            except socket.error:
+                # An final socket error may have occurred here, such as
+                # the local error ECONNABORTED.
+                pass
         self.wfile.close()
         self.rfile.close()
 

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


More information about the Python-checkins mailing list