[Twisted-Python] XMLRPC get IP address

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Mon Dec 14 13:01:35 EST 2009


On 05:32 pm, landreville at deadtreepages.com wrote:
>Hello,
>
>I've looked through the mailing list and already found this reference 
>to get
>the IP address when using xmlrpc:
>
>http://twistedmatrix.com/pipermail/twisted-python/2004-June/007987.html
>
>But it is not working.
>
>I have added this to my class that inherits from xmlrpc.XMLRPC
>
>def render(self, request):
>self.request = request
>xmlrpc.XMLRPC.render(self, request)
>
>
>Now when I call any function the log says:
>2009-12-14 12:29:18-0500 [-]
>/usr/local/lib/python2.6/dist-packages/Twisted-9.0.0-py2.6-linux- 
>x86_64.egg/twisted/web/xmlrpc.py:148:
>exceptions.UserWarning: Warning! request.finish called twice.
>
>I have two XMLRPC classes, and one of them is a subHandler, but the
>subhandler's render method never gets called as far as I've seen (so it
>shouldnt be causing request.finish to be called twice)  and just to be 
>sure
>I added this to only the parent XMLRPC class.
>
>Any ideas why this would cause request.finish to be called twice?

Make sure you return the result of calling xmlrpc.XMLRPC.render.

Jean-Paul



More information about the Twisted-Python mailing list