10 Jun 23:18
Help debugging pingbacks
Hi,
I'm trying to fix up autopingback.py so that I can eventually think
about getting it into a plugin, and whilst I've now fixed it so that
it can send the request, when xmlrpclib receives the response object,
expat dies on trying to parse it. This is because, for some reason,
the stream (handled by xmlrpclib.Transport.request with the line
"h.getfile()") is not just HTTP. Instead, I get "33\n" twice, followed
by the config dict, then the expected information (Content-Type,
Content-Length and the xmlrpc response). The stream thus looks
something like
33
33
{ ....
... "config" : "stuff" ...
... }
Content-Type: text/xml
Content-Length: 226
<?xml version='1.0'?>
<methodResponse>
...
...
</methodResponse>
When I look in the "xmlrpc.py" plugin at the data at
xmlrpc.XMLRPCHandler._request.getResponse(), I only have the xml
returned in the stream. This suggests that somewhere between the
xmlrpc plug-in and autoping.py, the data is being mangled. It doesn't
seem to be anywhere in autoping.py, nor does it seem to be anywhere in
Pyblosxom.Response. So, I'm at a loss. Weirdly, 33 = 0x21, which is
the error code in the pingback spec[1] for "The specified target URL
cannot be used as a target". However, nowhere in xmlrpc_pingback.py
seems to be generating that number, and that error is not true for the
URL, and "33" is returned for all URLs, so I don't think that's what
it is.
The traceback I get from autoping.py [2] is
*** Pingback:
Server http://fulltinreality.com/blog/RPC,
Target http://fulltinreality.com/blog/shiny,
URL http://fulltinreality.com/blog/test-entry
Traceback (most recent call last):
File "../autoping.py", line 192, in pingback
logger.info(server.pingback.ping(parser.url,target))
File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.6/xmlrpclib.py", line 1387, in _parse_response
p.feed(response)
File "/usr/lib/python2.6/xmlrpclib.py", line 601, in feed
self._parser.Parse(data, 0)
ExpatError: syntax error: line 1, column 0
2009-06-10 21:07:51,779 [ERROR]: syntax error: line 1, column 0
You can get my version of the script at [2].
[1] http://www.hixie.ch/specs/pingback/pingback#TOC3
[2] http://fulltinreality.com/dev/pyblosxom/autoping.py
Regards,
--
--
Toby Smithe :: http://fulltinreality.com
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
RSS Feed