Apple - Prevent "<application> quit unexpectedly" message on sigquit

If you never want to see the crash report dialogs, there is a preference to disable them:

defaults write com.apple.CrashReporter DialogType none

Log out and back in to apply the changes.


You can also make the message appear as a notification instead:

defaults write com.apple.CrashReporter UseUNC 1

The default behavior when receiving SIGQUIT is to dump core and exit; the crash reporter is triggered as a part of this process.

Starting with 10.5(?) simply setting a signal handler for SIGQUIT should be sufficient to avoid the crash reporter; you will probably want the handler to also call exit.

import signal, sys, os

def sigquit_handler(signum, frame):
    print 'SIGQUIT received; exiting'
    sys.exit(os.EX_SOFTWARE)

signal.signal(signal.SIGQUIT, sigquit_handler)

# Do your normal work instead of this
print 'Waiting for a signal...'
signal.pause()

The above code was tested on 10.8.5 against /usr/bin/python which is 2.7.2.