支持msn协议的python包msnp.py的例程在FC4下跑有问题

这两天想实现通过msn发报警信息
于是就找了到了些python下用的支持msn的api
msnp算是一个
msnp文档上要求是python2.3+
我的FC4(Fedora Core 4)是python2.4
安装没有问题
测试也没有问题
能正常登录

就是msnp.py Tutorial有个例程:

# echobot.py -- echo messages back to sender

import msnp
import time

class MsnChatListener(msnp.ChatCallbacks):
def message_received(self, passport_id, display_name, text, charset):
print '%s: %s' % (passport_id, text)
self.chat.send_message(text, charset)

class MsnListener(msnp.SessionCallbacks):
def chat_started(self, chat):
callbacks = MsnChatListener()
chat.callbacks = callbacks
callbacks.chat = chat

msn = msnp.Session(MsnListener())
msn.login('trinity@hotmail.com', 'Z10N0101')

while True:
msn.process(chats = True)
time.sleep(1)

系统提示:

Traceback (most recent call last):
File “test4.py”, line 21, in ?
msn.process(chats = True)
File “/usr/lib/python2.4/site-packages/msnp/session.py”, line 340, in process
self.__process_command_buf(buf)
File “/usr/lib/python2.4/site-packages/msnp/session.py”, line 364, in __process_command_buf
c.parse(buf)
File “/usr/lib/python2.4/site-packages/msnp/command.py”, line 46, in parse
self.trn, pos = int(s[pos]), pos + 1
ValueError: invalid literal for int(): ver=”2″

不知道什么原因
5555555555555555555

Discussion Area - Leave a Comment




*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word