<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Chris,</div><div><br></div><div>My original reply jumped into the middle of the thread and I didn't completely understand what you were asking. &nbsp;Let's get back to your original message:</div><div><br></div><div><div>On Sep 28, 2010, at 9:48 AM, Chris Withers wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">The loop() function is supposed to be a "catch all and report" error handler. However, when the async code initiated by doStuff throws the AttributeError, what actually gets logged is:<br><br>2010-09-28 14:41:15,706 ERROR &nbsp;&nbsp;: log &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(14757|7f691ba676e0): Unhandled Error<br>Traceback (most recent call last):<br>&nbsp;File "test_looping.py", line 41, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;reactor.run()<br>&nbsp;File "Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/internet/base.py", line 1128, in run<br>&nbsp;&nbsp;&nbsp;self.mainLoop()<br>&nbsp;File "Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/internet/base.py", line 1137, in mainLoop<br>&nbsp;&nbsp;&nbsp;self.runUntilCurrent()<br>--- &lt;exception caught here&gt; ---<br>&nbsp;File "Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/internet/base.py", line 757, in runUntilCurrent<br>&nbsp;&nbsp;&nbsp;call.func(*call.args, **call.kw)<br>&nbsp;File "test_looping.py", line 24, in __call__<br>&nbsp;&nbsp;&nbsp;del self.connector<br>exceptions.AttributeError: Break instance has no attribute 'connector'<br></span></span></blockquote></div><br><div>This traceback indicates a bug in Twisted.</div><div><br></div><div>This is an error that other people have very occasionally spotted, and we have never been able to reliably reproduce it. &nbsp;Over the years we have tried to diagnose it in various ways and we have always failed.</div><div><br></div><div>It would be really valuable to everyone if you could write up a bug and provide detailed reproduction instructions, ideally with some python code that triggers this error, so that we can address the bug. &nbsp;It would be super useful if you could write an example that reproduces the same bug on a recent Twisted version (8.2 is pretty old), especially the 10.2 prerelease. &nbsp;But, if your example reproduces on 8.2 and not 10.0, that tells us something too.</div><div><br></div><div>A unit test would be best, but any complete script which reproduces the problem reliably would be extremely useful; we can transform it into a unit test ourselves.</div><div><br></div><div>To reiterate, as this pertains to your problem: there is no way for your application code to fix this exception, because it is happening in the guts of the reactor and entirely out of your control. &nbsp;It is going to screw things up in some pretty arbitrary ways. &nbsp;The only way to deal with it would be to figure out why it happens and come up with a proper fix for the bug. &nbsp;And we can't do that without a way to reproduce the bug.</div><div><br></div><div>Thanks for your help,</div><div><br></div><div>-glyph</div><div><br></div></body></html>