python – 使用msn协议运行twisted.words示例的问题
作者:互联网
我目前正在尝试使用Twisted库专门扭曲的单词来尝试与MSN进行交互.但是当我运行twisted提供的示例脚本时,我收到错误.具体来说,错误发现在这里http://i42.tinypic.com/wl945w.jpg.脚本可以在这里找到http://twistedmatrix.com/projects/words/documentation/examples/msn_example.py.
平台是使用Python 2.6的Vista
编辑:完整输出:
Email (passport): mypassport@hotmail.com
Password: ******
2009-04-25 10:52:49-0300 [-] Log opened.
2009-04-25 10:52:49-0300 [-] Starting factory <twisted.internet.protocol.ClientFactory instance at 0x9d87e8c>
2009-04-25 10:52:55-0300 [Dispatch,client] Starting factory <twisted.words.protocols.msn.NotificationFactory instance at 0x9e28bcc>
2009-04-25 10:52:55-0300 [Dispatch,client] Stopping factory <twisted.internet.protocol.ClientFactory instance at 0x9d87e8c>
2009-04-25 10:52:55-0300 [Notification,client] Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python2.5/site-packages/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/local/lib/python2.5/site-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/local/lib/python2.5/site-packages/twisted/internet/tcp.py", line 460, in doRead
return self.protocol.dataReceived(data)
File "/usr/local/lib/python2.5/site-packages/twisted/protocols/basic.py", line 238, in dataReceived
why = self.lineReceived(line)
File "/usr/local/lib/python2.5/site-packages/twisted/words/protocols/msn.py", line 651, in lineReceived
handler(params.split())
File "/usr/local/lib/python2.5/site-packages/twisted/words/protocols/msn.py", line 827, in handle_USR
d = _login(f.userHandle, f.password, f.passportServer, authData=params[3])
File "/usr/local/lib/python2.5/site-packages/twisted/words/protocols/msn.py", line 182, in _login
reactor.connectSSL(_parsePrimitiveHost(nexusServer)[0], 443, fac, ClientContextFactory())
exceptions.TypeError: 'NoneType' object is not callable
2009-04-25 10:52:55-0300 [Notification,client] Stopping factory <twisted.words.protocols.msn.NotificationFactory instance at 0x9e28bcc>
解决方法:
由于MSN涉及SSL连接,因此必须安装pyOpenSSL才能使用它.好像你可能没有.但是,这并不是Twisted报告此缺失依赖项的好方法.我建议在Twisted问题跟踪器中提交票证以改进此报告.
标签:python,twisted,msn,twisted-words 来源: https://codeday.me/bug/20190522/1151957.html