<br><div class="gmail_quote">On Mon, Jul 16, 2012 at 11:45 PM, Dan Stromberg <span dir="ltr">&lt;<a href="mailto:drsalists@gmail.com" target="_blank">drsalists@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><div class="gmail_quote"><div class="im">On Mon, Jul 16, 2012 at 11:20 PM, Andrew Bennetts <span dir="ltr">&lt;<a href="mailto:andrew@bemusement.org" target="_blank">andrew@bemusement.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Dan Stromberg wrote:<br>
[…]<br>
<div>&gt; I&#39;m playing with twisted.internet.defer.setDebugging now.<br>
&gt;<br>
&gt; Is there a corresponding function that can be used to produce its report?<br>
&gt; If I use it in a program with an infinite loop, it seems like I never get<br>
&gt; the report, but if I use it in a program with a finite length, I eventually<br>
&gt; get a useful-looking report.<br>
<br>
</div>It&#39;s triggered by garbage collection of a Deferred with an unhandled error.  So<br>
you&#39;re at the mercy of when the garbage collector of your Python VM decides to<br>
collect that object.<br>
<br>
You could call yourDeferred._debugInfo._getDebugTracebacks() yourself, though,<br>
if you don&#39;t mind (ab)using private attributes that might break without warning.</blockquote></div><div><br>Strangely, this doesn&#39;t give the report until after the sleep finishes...   ?<br><br></div></div></blockquote>
<div>It turned out that I needed to print  d._debugInfo._getDebugTracebacks(), rather than just running d._debugInfo._getDebugTracebacks().<br><br>However, it always appears to print the debug tracebacks for the deferred named - in this case, d.  It doesn&#39;t appear to be selecting the correct deferred(s) to print.<br>
<br><br></div></div>