[Python-Dev] Test failures under Windows?

Curt Hagenlocher curt at hagenlocher.org
Wed Mar 25 13:53:45 CET 2009


2009/3/25 Kristján Valur Jónsson <kristjan at ccpgames.com>:
>
> I'm going to poke my contacts at Microsoft and ask them if there is
> a way to disable popups like this for a process that runs unattended
> and/or is running as a windows service.

MSVC has shipped with runtime library source since the 16-bit days, so
the easier thing is just to read the source code.  :)

It looks like there are two possible code paths for the assertion.
The first code path uses functions in dbgrpt[t].c and its behavior is
controlled by CrtSetReportMode and CrtSetReportFile.  The second uses
functions in assert.c and its behavior is controlled by
_set_error_mode.  Both code paths use __crtMessageBox in crtmbox.c to
actually display the message box.  This function -- when running as a
service -- will helpfully set MB_SERVICE_NOTIFICATION before calling
the USER32 MessageBox, which ensures that you'll see exactly why your
service has hung the next time you actually log in with sufficient
rights. :/

The variation that goes through assert.c should write to stderr for a
console-mode application, so it's reasonable to assume that we're
hitting the other code path -- and that Mark's suggestion to use
CrtSetReportMode would address the issue.

--
Curt Hagenlocher
curt at hagenlocher.org


More information about the Python-Dev mailing list