From 7b54e7562d44826947d2e5167dcfdc7b91a7f181 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Charles-Fran=C3=A7ois=20Natali?= Date: Tue, 24 May 2011 18:23:15 +0200 Subject: [PATCH] Issue #5715: In socketserver, close the server socket in the child process. --- Lib/socketserver.py | 2 +- Misc/NEWS | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 3d32c3ea19..76ac50a619 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -529,10 +529,10 @@ class ForkingMixIn: 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 index 37bbbc19b3..17f933a8ac 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -75,6 +75,8 @@ Core and Builtins 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. -- 2.40.0