[Python-Dev] Windows buildbot trick
David Bolen
db3l.net at gmail.com
Fri Jul 18 18:18:34 CEST 2008
Thomas Heller <theller at ctypes.org> writes:
> The most annoying thing on the windows buildbots is when Python crashes hard
> (with a general protection fault or stack overflow, for example).
> Usually the system pops up a dialog in this case which allows to
> attach a debugger to the process. This dialog will stay open until
> the maintainer manually closes it, and will prevent the next builds.
>
> On my boxes I have inserted these two lines into the PythonXY/Scripts/buildbot
> script, right at the top:
>
> import win32api; win32api.SetErrorMode(7)
> print "SetErrorMode(7) called."
>
> These lines prevent the dialog box to be displayed for critical errors.
For my buildbot, I've been running similarly modified buildbot code
since late 2007 (in commands.py, surrounding the spawning of a process
to execute a step) so it covers any use of the buildbot (mine was also
building MSIs). I had to modify buildbot to fix a file upload bug
anyway, so didn't mind running a patched version.
Technically using 0x8007 rather than just 7 would also cover a
possible missing file dialog, but not crucial.
It hasn't been 100% foolproof, as I seem to recall once or twice still
having to clear a dialog, but I think that was from the CRT within
Python itself, which there was an old discussion about changing the
Python code to initialize differently. It definitely catches the
Windows hard failures though.
-- David
More information about the Python-Dev
mailing list