Pressing Ctrl+C calls signal_handler() which then run sys.exit(0). Apparently, sys.exit() only throws an exception. Since the entire while loop is encapsulated in a try/except, the script will not exit properly while looping through submissions. This will need to be moved to os._exit() instead of sys.exit().