[Twisted-Python] Unhandled error in Deferred with twisted-8.2.0, but not with twisted-2.1.0
Rutt, Benjamin
Benjamin.Rutt at gs.com
Fri Jun 26 10:33:06 MDT 2009
Am currently trying to upgrade to twisted-8.2.0. For some reason,
twisted-8.2.0 thinks my deferred below was gc'd with an unhandled error,
and tells me about it upon reactor exit. With
python-2.4.2/twisted-2.1.0, no issues. With python-2.6.1/twisted-8.2.0,
I see these issues. Any ideas why? Thanks.
$ cat ./deferred-errors.py
#!/usr/bin/env python
import datetime, logging, os, random, re, shutil, socket
import subprocess, sys, tempfile, threading, time, traceback
from twisted.internet import reactor
from twisted.internet import defer
from twisted.internet.utils import getProcessOutput
from twisted.python import log
import twisted
print 'twisted version is', twisted.__version__
def foo():
d = getProcessOutput('/bin/hostnameX')
def cb(result):
print 'cb: %s' % (result)
def eb(failure):
print 'eb caught the failure!'
d.addCallback(cb)
d.addErrback(eb)
reactor.callWhenRunning(foo)
reactor.callLater(3, reactor.stop)
reactor.run()
$ /sw/external/python-2.4.2/bin/python ./deferred-errors.py
twisted version is 2.1.0
eb caught the failure!
$ /sw/external/python-2.6.1/bin/python ./deferred-errors.py
twisted version is 8.2.0
eb caught the failure!
Unhandled error in Deferred:
Traceback (most recent call last):
Failure: twisted.internet.error.ProcessTerminated: A process has ended
with a probable error condition: process ended with exit code 1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20090626/dcb43718/attachment.html>
More information about the Twisted-Python
mailing list