我正在尝试通过网络发送序列化对象,直到今天,它工作得很好。
现在我有一个错误:
@staticmethod
def processkeys(self):
'''
This method has to be static as it is used as a tarked for a Thread.
All it does by now is receive a mouseAndKeyWrapperobject from the client and
set this instances object to it.
'''
logging.getLogger(__name__).warning("keys processed")
print("here")
sock = self.sock
Id = self.id
from modules.logic import game
self.myPlayer = game.get_player()
while True:
try:
myMakw = sock.recv(4096)
self.makw = loads(myMakw)
self.movePlayers(self.makw)
except:
logging.getLogger("nothing from Client")
self.wrap.addPlayer(self.myPlayer)
wrapToSend = dumps(self.wrap, 2)
sock.sendall(wrapToSend)
工作正常,直到最后一行之前:转储产生以下错误消息:
wrapToSend = dumps(self.wrap, 2)
AttributeError: 'module' object has no attribute 'py_decode_TypedWritable_from_bam_stream'
我以前用这种方法序列化和反序列化对象,甚至是自己编写的对象,但从来没有得到过这样的东西。甚至谷歌似乎也不知道那个特定的错误消息(零命中)。
有谁知道出了什么问题?