[Twisted-Python] The case of the missing Traceback
Terry Jones
terry at jon.es
Tue Nov 3 15:11:04 EST 2009
>>>>> "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
More information about the Twisted-Python
mailing list