简体   繁体   English

使用python ping Pingomatic(XMLRPC)时出错

[英]Error while pinging Pingomatic (XMLRPC) using python

I'm trying to ping Pingomatic using python. 我正在尝试使用python ping Pingomatic。

I've written this: 我写了这个:

import xmlrpclib

print "START"

s = xmlrpclib.Server('http://rpc.pingomatic.com')
reply = s.weblogUpdates.ping('Test','http://www.testblog.com')

print "END"

But when I run, i get: 但是当我跑步时,我得到:

>>> 
START

Traceback (most recent call last):
  File "C:/xxxxxxxxxxxxxxxxxx/pingtest1.py", line 6, in <module>
    reply = j.weblogUpdates.ping('Test','http://www.testblog.com')
  File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "C:\Python27\lib\xmlrpclib.py", line 1570, in __request
    verbose=self.__verbose
  File "C:\Python27\lib\xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Python27\lib\xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "C:\Python27\lib\xmlrpclib.py", line 1462, in parse_response
    p.feed(data)
  File "C:\Python27\lib\xmlrpclib.py", line 557, in feed
    self._parser.Parse(data, 0)
ExpatError: syntax error: line 1, column 0
>>> 

How can I fix this? 我怎样才能解决这个问题?

Thank you. 谢谢。

It turns out this was an issue with Pingomatic's response format. 事实证明,这是Pingomatic的响应格式存在的问题。 I tried pinging Weblogs.com, and it worked fine. 我尝试ping Weblogs.com,但效果很好。

I emailed Automattic to let them know, and they've since fixed the issue -- everything should be working! 我通过电子邮件发送给Automattic,让他们知道,他们已经解决了该问题-一切都应该正常进行!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM