summaryrefslogtreecommitdiff
path: root/Lib/SocketServer.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-03 23:07:07 +0000
committerKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-03 23:07:07 +0000
commitb5faac73a44f8c0e86b37e448abcf6bb3c9de523 (patch)
treee65c4109cf303bf31b670b79cc0524c990f2550d /Lib/SocketServer.py
parent9d36fd2acbe618796ecfcb1dd6cb04e9d0f44c8f (diff)
downloadcpython-git-b5faac73a44f8c0e86b37e448abcf6bb3c9de523.tar.gz
http://bugs.python.org/issue6381
some platforms may raise ENOTCONN if the stack has disconnected the socket on behalf of the peer.
Diffstat (limited to 'Lib/SocketServer.py')
-rw-r--r--Lib/SocketServer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py
index 73cd219676..08f005b086 100644
--- a/Lib/SocketServer.py
+++ b/Lib/SocketServer.py
@@ -445,7 +445,12 @@ class TCPServer(BaseServer):
def close_request(self, request):
"""Called to clean up an individual request."""
- request.shutdown(socket.SHUT_WR)
+ try:
+ #explicitly shutdown. socket.close() merely releases
+ #the socket and waits for GC to perform the actual close.
+ request.shutdown(socket.SHUT_WR)
+ except socket.error:
+ pass #some platforms may raise ENOTCONN here
request.close()