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

F

Follower

Hi,

I've run into an issue which seems to have been discussed previously
on `python-dev` but only in context of Zope3:

"Fun with 2.3 shutdown" -- Tim Peters
<http://mail.python.org/pipermail/python-dev/2003-September/038151.html>

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:
"""

It doesn't always happen consistently. As a comparison, I have run the
same script under Python 2.2.2 and the problem does not seem to occur
there. (Although, of course, with threads that's no guarantee...)

I had a look at the bug list on Sourceforge and this issue doesn't
seem to have made it there yet, so I thought I'd raise it here, partly
as Google-bait and partly to see if I should re-raise the issue on
`python-dev`.

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

--Phil.
 
J

Jeremy Fincher

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top