On Wed, 27 Oct 2004 09:50:46 -0500, Skip Montanaro firstname.lastname@example.org wrote:
The current behavior of the atexit module is that if any of the exit handlers raises an exception the remaining handlers are not run. Greg Chapman posted a bug report about this:
Greg proposed catching any exceptions and continuing so that all exit handlers at least have a chance to run and Raymond agrees with him. I attached a patch to the ticket to add a flag to determine the behavior on the principle that atexit has been around long enough that someone out there probably relies on the early exit behavior. This is the old Python chestnut of using a flag to preserve existing behavior as the default while allowing users to set the flag to get the new behavior.
I'm happy to go either way, but thought perhaps a quick poll of the troops might be in order, hence this note.
If I were a user of the atexit module and aware of this behavior, I'd consider it a bug write my atexit handler to avoid ever raising an exception, because I didn't want to jeopardize other atexit handlers. So I think preserving backwards-compatible behavior is unnecessary.