]> granicus.if.org Git - python/commitdiff
Issue 5619: Pass MS CRT debug flags into subprocesses
authorJesse Noller <jnoller@gmail.com>
Tue, 31 Mar 2009 22:20:35 +0000 (22:20 +0000)
committerJesse Noller <jnoller@gmail.com>
Tue, 31 Mar 2009 22:20:35 +0000 (22:20 +0000)
Misc/ACKS
Misc/NEWS
Modules/_multiprocessing/win32_functions.c
Python/pythonrun.c

index 401b29ee2f03e33a9979f66ffe5a7d465258b2e6..d5b055cd90283aa0d6c99104489e42fa042a8367 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -685,6 +685,7 @@ Daniel Stutzbach
 Nathan Sullivan
 Mark Summerfield
 Hisao Suzuki
+Andrew Svetlov
 Kalle Svensson
 Paul Swartz
 Thenault Sylvain
index 6bded6b0f0726676a2c3c65485e916d4d343f6a6..aa99ac005cb907e2fea919c5c9fb671e9b8fa615 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -199,6 +199,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #5619: Multiprocessing children disobey the debug flag and causes
+  popups on windows buildbots. Patch applied to work around this issue.
+
 - Issue #5632: Thread.ident was None for the main thread and threads not created
   with the threading module.
 
index 513fc02b1a5d1cfa8a77c81fe4e0bce1b4e92214..549c15198301f303f7cf9591a234d159ccdb0d36 100644 (file)
@@ -130,6 +130,12 @@ 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;
index d0c5b2bf3484c4215eefc8035cafbbc3e1d0db3b..b3866cebb88ce19b8e40cd99752a33fd48f64c88 100644 (file)
@@ -1634,6 +1634,8 @@ void
 Py_FatalError(const char *msg)
 {
        fprintf(stderr, "Fatal Python error: %s\n", msg);
+       fflush(stderr); /* it helps in Windows debug build */
+
 #ifdef MS_WINDOWS
        {
                size_t len = strlen(msg);