<br><br><div class="gmail_quote">On Jan 4, 2008 2:46 AM, Guido van Rossum &lt;<a href="mailto:guido@python.org">guido@python.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
See <a href="http://bugs.python.org/issue1731" target="_blank">http://bugs.python.org/issue1731</a>. Should we consider it safe to<br>backport r57216 to 2.5.2? This is Thomas Wouters&#39;s code to disable<br>spurious tracebacks when daemon threads die. We&#39;re running some 
2.4<br>apps with (a variant of) this at Google that get many 1000s of<br>invocations a day, so I&#39;m pretty confident that it works.<br><font color="#888888"></font></blockquote><div><br>I&#39;m also pretty confident it works, although it isn&#39;t really guaranteed to catch *all* such situations. No reason not to backport it, just a remark about how it checks to see if Python is shutting down. It is, however, incredibly unlikely &#39;_sys&#39; won&#39;t be gone when we check for it if the exception is indeed a spurious one. What could happen is that a legitimate exception happens right before interpreter shutdown, then a thread switch occurs before Python tries to report the exception, the interpreter exits, and then the daemonic thread starts to report its exception. The only way to catch that is to do the &#39;are we exiting&#39; check in the C code that does the actual thread-exception reporting. I&#39;m not sure if it&#39;s worth it, as the timing has to be pretty exact for that to happen, and you wouldn&#39;t want to introduce a bug there; could be years before someone figures it out :P
<br></div></div><br>-- <br>Thomas Wouters &lt;<a href="mailto:twouters@google.com">twouters@google.com</a>&gt;<br><br>Hi! I&#39;m a .signature virus! copy me into your .signature file to help me spread!