[PEAK] Problems with events.twisted_support

John Landahl john at landahl.org
Thu Feb 5 18:08:56 EST 2004


I've run into two problems with events.twisted_support when using its 
EventLoop on a Deferred, with code like "output = 
eventLoop.runUntil(deferred, True)".  The attached file shows two 
tracebacks, the first of which occurs when this line of code is run.  The 
second traceback occurred after I tried a quick fix (changing line 68 of 
twisted_support.py to "func(self.subject, self.subject.result)"), which 
may not have been the right solution, but the traceback seems unrelated to 
what I did.
-------------- next part --------------
Traceback (most recent call last):
...
    output = eventLoop.runUntil(deferred, True)
  File "/usr/lib/python2.3/site-packages/peak/events/twisted_support.py", line 181, in runUntil
    adapt(eventSource,IEventSource).addCallback(
  File "/usr/lib/python2.3/site-packages/peak/events/twisted_support.py", line 68, in addCallback
    func(self.subject.result)
TypeError: <lambda>() takes exactly 2 arguments (1 given)

----------------------------------------------------------------------------

Traceback (most recent call last):
...
    output = eventLoop.runUntil(deferred, True)
  File "/usr/lib/python2.3/site-packages/peak/events/twisted_support.py", line 181, in runUntil
    adapt(eventSource,IEventSource).addCallback(
  File "/usr/lib/python2.3/site-packages/peak/events/twisted_support.py", line 68, in addCallback
    func(self.subject, self.subject.result)
  File "/usr/lib/python2.3/site-packages/peak/events/twisted_support.py", line 182, in <lambda>
    lambda s,e: [exit.append(e), self.reactor.crash()]
  File "C:\cygwin\home\pje\PEAK\src/peak/binding/_once.pyx", line 112, in _once.BaseDescriptor.__get__
  File "C:\cygwin\home\pje\PEAK\src/peak/binding/_once.pyx", line 100, in _once.__get__
  File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line 524, in computeValue
    return self.targetName.findComponent(obj, self.default)
  File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line 395, in findComponent
    return config.lookup(component, self.ob, default)
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 87, in lookup
    for value in iterValues(component, configKey):
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 69, in iterValues
    value = gcd(forObj, configKey)
  File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line 949, in _getConfigData
    value = attr.getValueFor(forObj, configKey)
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 309, in _getConfigData
    value = rule.get()(self, configKey, forObj)
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 194, in __call__
    return serviceArea.getService(self.configKey, create)
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 420, in getService
    return self.__services.get(ruleKey,NOT_FOUND,factory=factory)
  File "/usr/lib/python2.3/site-packages/peak/util/EigenData.py", line 262, in get
    return cell.get(factory)
  File "/usr/lib/python2.3/site-packages/peak/util/EigenData.py", line 77, in get
    self.value = setdefault()
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 185, in create
    factory = lookup(serviceArea, FactoryFor(self.configKey))
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 87, in lookup
    for value in iterValues(component, configKey):
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 69, in iterValues
    value = gcd(forObj, configKey)
  File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line 949, in _getConfigData
    value = attr.getValueFor(forObj, configKey)
  File "/usr/lib/python2.3/site-packages/peak/config/config_components.py", line 309, in _getConfigData
    value = rule.get()(self, configKey, forObj)
  File "/usr/lib/python2.3/site-packages/peak/config/ini_files.py", line 30, in f
    result = eval(expr,globalDict,locals())
  File "<string>", line 0, in ?
  File "/usr/lib/python2.3/site-packages/peak/events/api.py", line 28, in makeTwisted
    except AlreadyRead:
NameError: global name 'AlreadyRead' is not defined


More information about the PEAK mailing list