[New-bugs-announce] [issue14474] mishandling of AttributeError in threads
report at bugs.python.org
Mon Apr 2 14:08:20 CEST 2012
New submission from Pierre Ossman <ossman at cendio.se>:
These three things do not mix:
- Object methods
An unhandled AttributeError thrown in a thread will not call sys.excepthook if the thread's start function is a class/object method.
Note that you do not get a traceback here. Throwing any other exception type works fine, as does having worker() be a simple function.
I think I've traced the issue to Objects/classobject.c:instance_repr(). It tries to look up the method, making sure to handle any AttributeError this might cause. But it fails to save and restore and Exception currently already active, effectively clearing out the current exception.
components: Interpreter Core
title: mishandling of AttributeError in threads
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce