[IPython-dev] Issue in error path in case of invalid command

Albert Strasheim fullung at gmail.com
Wed Nov 8 17:52:18 CST 2006


Hello all

I'm back to playing with IPython1 on Windows again. As per the instructions 
in

http://projects.scipy.org/ipython/ipython/browser/ipython/branches/chainsaw/README

I started up my controller and my engine. In a script I did:

import ipython1.kernel.api as kernel
rc = kernel.RemoteController(('localhost', 10201))
print rc.getIDs()

When I run this, I get the following error:

2006/11/09 01:45 +0200 [VanillaEngineServerProtocol,1,127.0.0.1] Unhandled 
Error
        Traceback (most recent call last):
          File "C:\Python24\Lib\site-packages\twisted\python\log.py", line 
48, in callWithLogger
            return callWithContext({"system": lp}, func, *args, **kw)
          File "C:\Python24\Lib\site-packages\twisted\python\log.py", line 
33, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "C:\Python24\Lib\site-packages\twisted\python\context.py", 
line 59, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, 
**kw)
          File "C:\Python24\Lib\site-packages\twisted\python\context.py", 
line 37, in callWithContext
            return func(*args,**kw)
        --- <exception caught here> ---
          File 
"C:\Python24\Lib\site-packages\twisted\internet\selectreactor.py", line 139, 
in _doReadOrWrite
            why = getattr(selectable, method)()
          File "C:\Python24\Lib\site-packages\twisted\internet\tcp.py", line 
362, in doRead
            return self.protocol.dataReceived(data)
          File "C:\Python24\Lib\site-packages\twisted\protocols\basic.py", 
line 99, in dataReceived
            self.doData()
          File "C:\Python24\Lib\site-packages\twisted\protocols\basic.py", 
line 62, in doData
            self.stringReceived(self.__buffer)
          File 
"C:\Python24\lib\site-packages\ipython1\kernel\enginevanilla.py", line 558, 
in stringReceived
            self.nextHandler(msg)
          File 
"C:\Python24\lib\site-packages\ipython1\kernel\enginevanilla.py", line 576, 
in dispatch
            self.dieLoudly('Command could not be dispatched: ' + msg)
          File 
"C:\Python24\lib\site-packages\ipython1\kernel\enginevanilla.py", line 588, 
in dieLoudly
            log.msg('Protocol Error [%i]: ' % id + repr(a))
        exceptions.TypeError: int argument required

2006/11/09 01:45 +0200 [VanillaEngineServerProtocol,1,127.0.0.1] 
unregistered engine None
2006/11/09 01:45 +0200 [VanillaEngineServerProtocol,1,127.0.0.1] Unhandled 
Error
        Traceback (most recent call last):
          File "C:\Python24\Scripts\ipcontroller.py", line 51, in main
            reactor.run()
          File 
"C:\Python24\Lib\site-packages\twisted\internet\posixbase.py", line 218, in 
run
            self.mainLoop()
          File 
"C:\Python24\Lib\site-packages\twisted\internet\posixbase.py", line 229, in 
mainLoop
            self.doIteration(t)
          File 
"C:\Python24\Lib\site-packages\twisted\internet\selectreactor.py", line 133, 
in doSelect
            _logrun(selectable, _drdw, selectable, method, dict)
        --- <exception caught here> ---
          File "C:\Python24\Lib\site-packages\twisted\python\log.py", line 
48, in callWithLogger
            return callWithContext({"system": lp}, func, *args, **kw)
          File "C:\Python24\Lib\site-packages\twisted\python\log.py", line 
33, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "C:\Python24\Lib\site-packages\twisted\python\context.py", 
line 59, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, 
**kw)
          File "C:\Python24\Lib\site-packages\twisted\python\context.py", 
line 37, in callWithContext
            return func(*args,**kw)
          File 
"C:\Python24\Lib\site-packages\twisted\internet\selectreactor.py", line 149, 
in _doReadOrWrite
            self._disconnectSelectable(selectable, why, method=="doRead")
          File 
"C:\Python24\Lib\site-packages\twisted\internet\posixbase.py", line 256, in 
_disconnectSelectable
            selectable.connectionLost(failure.Failure(why))
          File "C:\Python24\Lib\site-packages\twisted\internet\tcp.py", line 
416, in connectionLost
            protocol.connectionLost(reason)
          File 
"C:\Python24\lib\site-packages\ipython1\kernel\enginevanilla.py", line 539, 
in connectionLost
            self.factory.unregisterEngine(self.id)
          File 
"C:\Python24\lib\site-packages\ipython1\kernel\enginevanilla.py", line 1026, 
in unregisterEngine
            return self.service.unregisterEngine(id)
          File 
"C:\Python24\Lib\site-packages\ipython1\kernel\controllerservice.py", line 
304, in unregisterEngine
            log.msg("engine %i was not registered" % id)
        exceptions.TypeError: int argument required

In this case, id is None and repr(a) is 'Command could not be dispatched: 
GETIDS'.

Cheers,

Albert 



More information about the IPython-dev mailing list