[IPython-dev] Having trouble using TaskClient; exception inside twisted

Andrew Wagner drewm1980@gmail....
Mon Feb 22 00:24:21 CST 2010


Hello-

I'm trying to use the TaskClient infrastructure, and I'm hitting some
exceptions I don't understand.  My python and twisted are from debian
testing.  I believe the versions in stable are too old to support task
clients, etc, which was my main motive for switching to testing.

On importing I get the warnings:
____________
from IPython.kernel import client
   ...:

/usr/lib/pymodules/python2.5/IPython/kernel/clientconnector.py:43:
DeprecationWarning: Importing class Tub directly from 'foolscap' is
deprecated since Foolscap 0.4.3. Please import foolscap.api.Tub
instead
  self.tub = Tub()
__________

On instantiation of a task client I get:

____________
In [7]: tc = client.TaskClient()
/usr/lib/pymodules/python2.5/IPython/kernel/taskfc.py:79:
DeprecationWarning: Importing class Referenceable1 directly from
'foolscap' is deprecated since Foolscap 0.4.3. Please import
foolscap.api.Referenceable instead
  class FCTaskControllerFromTaskController(Referenceable):
____________

Something similar for a multiengine client:

______________
In [8]: mec = client.MultiEngineClient()
/usr/lib/pymodules/python2.5/IPython/kernel/multienginefc.py:86:
DeprecationWarning: Importing class Referenceable1 directly from
'foolscap' is deprecated since Foolscap 0.4.3. Please import
foolscap.api.Referenceable instead
  class FCSynchronousMultiEngineFromMultiEngine(Referenceable):
_____________


The following example from the website and docs runs cleanly.
__________
serial_result = map(lambda x:x**10, range(200))
parallel_result = tc.map(lambda x:x**10, range(200))
assert serial_result==parallel_result
__________


However, when I run my code, at the point where I run tc.map() I'm
getting the following:

______________
Traceback (most recent call last):
  File "./objectives.py", line 165, in <module>
    e = objective_multithread(s)
  File "./objectives.py", line 150, in objective_multithread
    norms = tc.map(f, range(testingImageCount))
  File "/usr/lib/pymodules/python2.5/IPython/kernel/taskclient.py",
line 154, in map
    return self.mapper().map(func, *sequences)
  File "/usr/lib/pymodules/python2.5/IPython/kernel/mapper.py", line 230, in map
    task_results = [self.task_controller.get_task_result(tid) for tid
in task_ids]
  File "/usr/lib/pymodules/python2.5/IPython/kernel/taskclient.py",
line 93, in get_task_result
    taskid, block)
  File "/usr/lib/pymodules/python2.5/IPython/kernel/twistedutil.py",
line 72, in blockingCallFromThread
    return twisted.internet.threads.blockingCallFromThread(reactor, f, *a, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/internet/threads.py",
line 112, in blockingCallFromThread
    result.raiseException()
  File "/usr/lib/python2.5/site-packages/twisted/python/failure.py",
line 326, in raiseException
    raise self.type, self.value, self.tb
AttributeError: 'int' object has no attribute 'rfind'
________________

Any ideas/advice would be greatly appreciated.

Thanks,
Drew


More information about the IPython-dev mailing list