Python xmlrpclib参数传递

Python xmlrpclib参数传递,python,rpc,xmlrpclib,Python,Rpc,Xmlrpclib,我想使用Python RPC传递一些数据。我得到了正确的结果,但也有一个错误 xmlrpclib.Fault::浮点值的文本无效:127.0.0.1> 我没有改变任何事情,只是突然出错了。当我尝试使用PRC api传递数据时,它看起来像是参数问题。但我还是没有明白 回溯最近一次呼叫上次: 文件./gateway.py,第341行,在 选举站 文件./gateway.py,第155行,在选举站 ret=proxy.elec\u recvLEADER,候选端口[0:lessthan],候选添加[0

我想使用Python RPC传递一些数据。我得到了正确的结果,但也有一个错误

xmlrpclib.Fault::浮点值的文本无效:127.0.0.1>

我没有改变任何事情,只是突然出错了。当我尝试使用PRC api传递数据时,它看起来像是参数问题。但我还是没有明白

回溯最近一次呼叫上次: 文件./gateway.py,第341行,在 选举站 文件./gateway.py,第155行,在选举站 ret=proxy.elec\u recvLEADER,候选端口[0:lessthan],候选添加[0:lessthan],候选ID[0:lessthan] File/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第1224行,在调用中__ 返回self.\u sendself.\u名称,args 文件/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第1578行,在请求中 verbose=self.\uuu verbose 请求中的文件/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第1264行 返回self.single\u requesthost、处理程序、请求体、verbose 文件/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第1297行,在单次请求中 返回self.parse_responseresponse parse_响应中的File/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第1473行 返回u.close 文件/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py,第793行,关闭 提升故障**自身。\u堆栈[0] xmlrpclib.Fault:
您正在将参数127.0.0.1传递给服务器上的一个函数,该函数需要float类型的参数。

是否可以使用回溯而不是图像发布代码?很抱歉,当然可以。我刚才补充说。我返回了字符串,数组,数组,实际上不是。我不想使用float。我想一切都应该是线
def election_stop():
    time.sleep(5)
    while 1:
        global candidate_ids,candidate_adds,candidate_ports,lessthan
        if take_over==True and lessthan<=devices_attached:
        index_=candidate_ids.index(max(candidate_ids))
        add_s=candidate_adds[index_]
        port_s=candidate_ports[index_]
        print candidate_adds
        print "[Gateway]"+str(add_s)+str(port_s)+"win"
    try:
        proxy = xmlrpclib.ServerProxy("http://"+add_s+":"+str(port_s)+"/")
        ret = proxy.elec_recv("WIN",str(port_s),str(add_s),"you win pls takeover")
        #ret = proxy.elec_recv("LEADER",candidate_ports[0:lessthan],candidate_adds[0:lessthan],candidate_ids[0:lessthan])
        ret = proxy.elec_recv("LEADER",candidate_ports[0:lessthan],candidate_adds[0:lessthan],candidate_ids[0:lessthan])
        break
    except socket_error,exceptions.ValueError:
        print socket_error
        continue
    return "stop"