Noah Slater wrote: > Exception in thread Thread-88 (most likely raised during interpreter > shutdown): > Traceback (most recent call last): > File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap > File "/usr/share/rss2email/rss2email.py", line 268, in run > exceptions.AttributeError: 'NoneType' object has no attribute 'exc_info' > Unhandled exception in thread started by > Error in sys.excepthook: > > Original exception was: > Exception in thread Thread-87 (most likely raised during interpreter > shutdown): > Traceback (most recent call last): > File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap > File "/usr/share/rss2email/rss2email.py", line 268, in run > exceptions.AttributeError: 'NoneType' object has no attribute 'exc_info' > Unhandled exception in thread started by > Error in sys.excepthook: > > Original exception was:
I wish you could provide a bit more information, such as a feed that
causes this crash, whether the crash happens all the time (or perhaps
only when there's a slow feed?), whether you have overridden
FEED_TIMEOUT in config.py, if previous versions of rss2email
worked, and if you're using UML.
The best I can come up with using the limited information you've given
is to observe that threading.py contains this comment:
# Need to store a reference to sys.exc_info for printing
# out exceptions when a thread tries to use a global var. during interp.
# shutdown and thus raises an exception about trying to perform some
# operation on/with a NoneType
__exc_info = _sys.exc_info
Which suggests that this patch might allow it to display the real exception:
diff --git a/rss2email.py b/rss2email.py
index ca86120..e7af72e 100644
--- a/rss2email.py
+++ b/rss2email.py
@@ -256,6 +256,8 @@ def timelimit(timeout, function):
from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473878
"""
class Calculator(threading.Thread):
+ __exc_info = sys.exc_info
+
def __init__(self):
threading.Thread.__init__(self)
self.result = None
@@ -265,7 +267,7 @@ def timelimit(timeout, function):
try:
self.result = function(*args, **kw)
except:
- self.error = sys.exc_info()
+ self.error = self.__exc_info()
c = Calculator()
c.setDaemon(True) # don't hold up exiting
--
see shy jo
signature.asc
Description: Digital signature

