[Twisted-Python] Re : Telnet server using Twisted and AuthenticatingTelnetProtocol

filoufake-python at yahoo.fr filoufake-python at yahoo.fr
Mon Aug 24 19:07:51 EDT 2009


Thank you Jean-Paul for replying,

I still have some things that I don't understand:

If I put your piece of code in my factory's protocol, I can connect to the server but as soon as I enter the username, I got the an error message telling that Server doesn't support "will" ('Server' object has no attribute 'will').

2009-08-25 00:32:40+0200 [-] Log opened.
2009-08-25 00:32:40+0200 [-] twisted.internet.protocol.ServerFactory starting on 4738
2009-08-25 00:32:40+0200 [-] Starting factory <twisted.internet.protocol.ServerFactory instance at 0x00D828F0>
2009-08-25 00:32:45+0200 [AuthenticatingTelnetProtocol,0,127.0.0.1] Unhandled Error
        Traceback (most recent call last):
          File "C:\Python26\lib\site-packages\twisted\python\log.py", line 84, in callWithLogger
            return callWithContext({"system": lp}, func, *args, **kw)
          File "C:\Python26\lib\site-packages\twisted\python\log.py", line 69, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "C:\Python26\lib\site-packages\twisted\python\context.py", line 59, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "C:\Python26\lib\site-packages\twisted\python\context.py", line 37, in callWithContext
            return func(*args,**kw)
        --- <exception caught here> ---
          File "C:\Python26\lib\site-packages\twisted\internet\selectreactor.py", line 146, in _doReadOrWrite
            why = getattr(selectable, method)()
          File "C:\Python26\lib\site-packages\twisted\internet\tcp.py", line 463, in doRead
            return self.protocol.dataReceived(data)
          File "C:\Python26\lib\site-packages\twisted\protocols\basic.py", line 231, in dataReceived
            why = self.lineReceived(line)
          File "C:\Python26\lib\site-packages\twisted\conch\telnet.py", line 925, in lineReceived
            newState = getattr(self, "telnet_" + oldState)(line)
          File "C:\Python26\lib\site-packages\twisted\conch\telnet.py", line 967, in telnet_User
            self.transport.will(ECHO)
        exceptions.AttributeError: 'Server' object has no attribute 'will'

I understand that this has something to do with TelnetTranport but how to implement it?
I read the telnet_echo.tac but in my case I have to manage the portal also and that is a litle bit too complex for me.

You say also that AuthenticatingTelnetProtocol  expects to be connected to an ITelnetTransport, but the documentation says "When the information is collected, it is passed to a portal and an avatar 
implementing ITelnetProtocol is requested". 
I'm lost.

May I abuse to ask you to tell how to do?

Many thanks

Philippe



      



More information about the Twisted-Python mailing list