我目前正在编写一个使用 suds 包连接到新客户端的 Python 脚本。当我使用 url 调用 suds.Client 时,出现递归错误:
RuntimeError: maximum recursion depth exceeded while pickling an object
File "c:\Users\mdriscoll\Documents\projects\test_soap\test_soap.py", line 112, in <module>
main(sys.argv[1:])
File "c:\Users\mdriscoll\Documents\projects\test_soap\test_soap.py", line 100, in main
sendSOAPMsg(agency, fax_id, fax_num, setxid)
File "c:\Users\mdriscoll\Documents\projects\test_soap\test_soap.py", line 32, in sendSOAPMsg
client = Client('https://somerandomclient.com/blahblah.svc?wsdl')
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\reader.py", line 152, in open
d = self.fn(url, self.options)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\wsdl.py", line 157, in __init__
self.open_imports()
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\wsdl.py", line 202, in open_imports
imp.load(self)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\wsdl.py", line 314, in load
d = Definitions(url, options)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\wsdl.py", line 136, in __init__
d = reader.open(url)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\reader.py", line 80, in open
cache.put(id, d)
File "c:\Users\mdriscoll\Documents\projects\test_soap\suds\cache.py", line 336, in put
bfr = pickle.dumps(object, self.protocol)
起初,我以为这与前面在 Stack 上提到的问题有关:
但这是 suds 的 schema.py 中的一个问题。我尝试了提到的补丁以防万一,但它没有效果,并且从未调用补丁中添加的日志记录,所以我知道这不是问题所在。
我在 Windows 上使用 suds 4.1 beta 运行 Python 2.6。注意:回溯中的 url 已被清除,因为我不允许提及他们的名字。