Experts:
您好!

my ifinger.tac file content like following:
fromtwisted.applicationimportinternet, 
servicefromtwisted.internetimportprotocol, reactor, 
deferfromtwisted.protocolsimportbasicclassFingerProtocol(basic.LineReceiver):
    deflineReceived(self, user):
        d = self.factory.getUser(user)

        defonError(err):
            return'Internal error in server'd.addErrback(onError)

        defwriteResponse(message):
            self.transport.write(message + '\r\n')
            self.transport.loseConnection()
        d.addCallback(writeResponse)

classFingerFactory(protocol.ServerFactory):
    protocol = FingerProtocoldef__init__(self, **kwargs):
        self.users = kwargsdefgetUser(self, user):
        returndefer.succeed(self.users.get(user, "No such user"))

application = service.Application('finger', uid=1, gid=1)
factory = FingerFactory(moshez='Happy and well')
internet.TCPServer(79, 
factory).setServiceParent(service.IServiceCollection(application))              
     


when running this script with command-line : twistd -y ifinger.tac, error 
occurs like :


Traceback (most recent call last):
    File "/usr/local/bin/twistd", line 7, in <module>
        import _preamble
ImportError: No module named '_preamble'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
    File "/usr/local/bin/twistd", line 9, in <module>
        sys.exc_clear()
AttributeError: 'module' object has no attribute 'exc_clear'


And i run python3 in interactive mode to check if exc_clear method is defined 
in sys,  command line like :
>>>import sys
>>>sys.__dict__["exc_clear"]
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
        sys.exc_clear()
KeyError: 'exc_clear'
>>>


Is there any configuration i should do ? please help to give me an answer.


 谢谢!!
----------------------------
姓名 : 吴志高/Charles
电话 : (+086)13410859946

邮箱 : wuzhiga...@163.com
================================================
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to