From: Kristján Valur Jónsson Date: Sat, 4 Jul 2009 15:09:25 +0000 (+0000) Subject: http://bugs.python.org/issue6381 X-Git-Tag: v3.2a1~2885 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c4f4178cbd22b49c19f56baa0b305cbb64b9e94;p=python http://bugs.python.org/issue6381 merging revision 73819 from trunk --- diff --git a/Lib/socketserver.py b/Lib/socketserver.py index e5f5778872..37df2bab33 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() diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index cac90f4dc9..8986741757 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -182,6 +182,8 @@ class SysModuleTest(unittest.TestCase): "under Windows, test would generate a spurious crash dialog") code = textwrap.dedent(""" import sys + import msvcrt + msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS) def f(): try: diff --git a/Modules/_multiprocessing/win32_functions.c b/Modules/_multiprocessing/win32_functions.c index ba82c23517..379a49515e 100644 --- a/Modules/_multiprocessing/win32_functions.c +++ b/Modules/_multiprocessing/win32_functions.c @@ -130,12 +130,6 @@ win32_ExitProcess(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "I", &uExitCode)) return NULL; - #if defined(Py_DEBUG) - SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); - #endif - - ExitProcess(uExitCode); return NULL;