[Twisted-Python] xmlrpc ExpatError

Wari Wahab wari at home.wari.org
Wed Jun 18 12:15:16 EDT 2003


Justin Johnson wrote:
> Hello,
> 
> I have an xmlrpc server using twisted.web.xmlrpc.XMLRPC.  I have been
> able to contect to it fine using just python's xmlrpclib on the client,
> and am now switching over to use twisted on the client as well.  I'm
> getting a wierd error though that I'm not sure how to track down.  Below
> is are snippets of my client code, server code, and the error I'm
> getting.

I've got this problem a while ago as well.. It costs me a few days of 
headaches, and no one here seems to be able to answer the question, 
until I did some probing myself.

> [client]
> def connectToServer(server):
> 	s = Proxy('http://%s:%s' % (server, config.portNumber))
> 	return s

Your fix:
s = Proxy('http://%s:%s/' % (server, config.portNumber))
-----------------------^

See if that solves your problem as it solves mine.

If it does, then the issue is that the request sent over to the twisted 
server looks like:

POST  HTTP/1.0 # Note the lack of '/'

Which then gets converted nicely to:

POST  HTTP/1.0 HTTP/0.9

-- 
Regards: Wari Wahab
RoughingIT - http://roughingit.subtlehints.net
PyBlosxom  - http://roughingit.subtlehints.net/pyblosxom





More information about the Twisted-Python mailing list