"Error in sys.excepthook" message from Python 2.3 multi-threaded script

Jeremy Fincher tweedgeezer at hotmail.com
Mon Oct 27 10:12:01 EST 2003


follower at iname.com (Follower) wrote in message news:<d2f38965.0310262008.2b170bcf at posting.google.com>...

> The following message is displayed (one or more times) when exiting
> (in this case via a `KeyboardInterrupt` exception) a multi-threaded
> Python 2.3 script (on Mac OS X 10.2.1):
> 
>     """
>     Unhandled exception in thread started by
>     Error in sys.excepthook:
> 
>     Original exception was:
>     """

The problem here is that some threads are still alive and kicking when
the shutdown has reset all module attributes to None.  I've had the
same problem in my test suite for Supybot.

> The script in question is a multi-threaded curses framework I'm
> developing, and I can post code if that's useful.

Exactly.  If I remember correctly, no adequate solution was found on
Python-dev.  You may want to either signal for your threads to die and
wait on their death before actually exiting, if it's an important
issue.

Jeremy




More information about the Python-list mailing list