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

Brian Granger ellisonbg@gmail....
Mon Feb 22 00:52:59 CST 2010


Andrew,

> 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.

What version of IPython are you using?  Trunk or latest stable (0.10)?

> 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):
> _____________

Don't worry to much about these errors.  I am aware of them, but need
to make a small change
to get rid of the warning.  Could you file a bug report as a reminder for me:

https://bugs.launchpad.net/ipython

>
> 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
> __________

Great, so things are basically working...

>
> 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'
> ________________

Hmm, haven't seen this last one.  Could you put together a small, self
contained example that
demonstrates the error.  Then I can track it down.

Cheers,

Brian

> Any ideas/advice would be greatly appreciated.
>
> Thanks,
> Drew
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu
ellisonbg@gmail.com


More information about the IPython-dev mailing list