Python pickle索引超出范围

时间:2013-01-14 18:10:38

标签: python windows macos sockets pickle

当我尝试在Windows机器上运行我的py文件时,我收到以下错误,一切正常,从Mac,但我不能让两台机器互相交谈。我必须在ascii'转储';如果是这样我怎么做?有什么建议?谢谢!

Traceback (most recent call last):
File "C:\Users\Keith\Desktop\rcserver\tcpserver_simpleReceive.py", line 23, in <module>
new_data = pickle.loads(data)
File "C:\Python27\lib\pickle.py", line 1382, in loads
return Unpickler(file).load()
File "C:\Python27\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Python27\lib\pickle.py", line 1165, in load_put
self.memo[self.readline()[:-1]] = self.stack[-1]
IndexError: list index out of range

转储:

if e.type == pygame.JOYAXISMOTION:
    client_socket.sendall (pickle.dumps(e.dict,0))

这是负载:

 data = client_socket.recv(1024)
new_data = pickle.loads(data)

0 个答案:

没有答案