[Python-checkins] r73819 - python/trunk/Lib/SocketServer.py
kristjan.jonsson
python-checkins at python.org
Sat Jul 4 01:07:07 CEST 2009
Author: kristjan.jonsson
Date: Sat Jul 4 01:07:07 2009
New Revision: 73819
Log:
http://bugs.python.org/issue6381
some platforms may raise ENOTCONN if the stack has disconnected the socket on behalf of the peer.
Modified:
python/trunk/Lib/SocketServer.py
Modified: python/trunk/Lib/SocketServer.py
==============================================================================
--- python/trunk/Lib/SocketServer.py (original)
+++ python/trunk/Lib/SocketServer.py Sat Jul 4 01:07:07 2009
@@ -445,7 +445,12 @@
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()
More information about the Python-checkins
mailing list