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

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


http://hg.python.org/cpython/rev/f13c06b777a7
changeset:   70332:f13c06b777a7
branch:      3.1
parent:      70311:bdfbe0b499af
user:        Charles-François Natali <neologix at free.fr>
date:        Tue May 24 18:23:15 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
@@ -529,10 +529,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)
                 os._exit(0)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -75,6 +75,8 @@
 Library
 -------
 
+- Issue #5715: In socketserver, close the server socket in the child process.
+
 - Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
   to be able to unload the module.
 

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


More information about the Python-checkins mailing list