[Twisted-Python] The case of the missing Traceback

Dan tw.1 at pyxos.com
Tue Nov 3 13:45:30 MST 2009


Awesome!  Thanks for helping out a noob Terry! :)


At 02:11 PM 11/3/2009, you wrote:
> >>>>> "Dan" == Dan  <tw.1 at pyxos.com> writes:
>Dan> I was playing around with Twisted today and ran into a problem where
>Dan> Tracebacks aren't emitted on stderr after a deferred callback from a
>Dan> process called launched by reactor.spawnProcess.  The simplified test
>Dan> case is below.  I put "x = y" in the callback function to generate an
>Dan> exception, y doesn't exist.  Uncomment "x = z" right before the
>Dan> callback and it produces the traceback on stderr just fine.
>
>Hi Dan
>
>The callback function raises an exception, which Twisted converts to
>failure and stores in the deferred. But seeing as there are no errback
>functions in the deferred *and you leave the reactor running*, the failure
>just sits there (just as it should). If you do a 'from twisted.python
>import log' and Change the addCallback line in test() to look like this
>
>      d.addCallback(response).addErrback(log.err)
>
>You'll see the expected NameError just fine.
>
>Terry
>
>_______________________________________________
>Twisted-Python mailing list
>Twisted-Python at twistedmatrix.com
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list