[Python-checkins] cpython (merge 3.2 -> default): Issue #5715: In socketserver, close the server socket in the child process.

charles-francois.natali python-checkins at python.org
Tue May 24 18:30:26 CEST 2011


http://hg.python.org/cpython/rev/0e56d79fa2ab
changeset:   70334:0e56d79fa2ab
parent:      70331:8f403199f999
parent:      70333:ccd59ba8145e
user:        Charles-François Natali <neologix at free.fr>
date:        Tue May 24 18:29:46 2011 +0200
summary:
  Issue #5715: In socketserver, close the server socket in the child process.

files:
  Lib/socketserver.py |  2 +-
  Misc/NEWS           |  2 ++
  2 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/socketserver.py b/Lib/socketserver.py
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -549,10 +549,10 @@
                 self.active_children = []
             self.active_children.append(pid)
             self.close_request(request)
-            return
         else:
             # Child process.
             # This must never return, hence os._exit()!
+            self.socket.close()
             try:
                 self.finish_request(request, client_address)
                 self.shutdown_request(request)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,8 @@
 - Issue #12166: Move implementations of dir() specialized for various types into
   the __dir__() methods of those types.
 
+- Issue #5715: In socketserver, close the server socket in the child process.
+
 - Correct lookup of __dir__ on objects. Among other things, this causes errors
   besides AttributeError found on lookup to be propagated.
 

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


More information about the Python-checkins mailing list