[docs] Bug in proxy-example @ http://docs.python.org/library/xmlrpclib.html#example-of-client-usage
Dirk Hasselbalch
dirk at hasselbalch.com
Fri Oct 19 21:05:27 CEST 2012
There's a bug in the how-to-use-xmlrpclib-with-a-proxy example at the
bottom of this page:
http://docs.python.org/library/xmlrpclib.html#example-of-client-usage
The example doesn't work, since httplib.HTTP does not have the
getresponse method that gets invoked from xmlrpclib.ServerProxy.
Changing line 8 to get the HTTPconnection enclosed in HTTP fixes the
issue. Diff (current <, fixed >)
< h = httplib.HTTP(self.proxy)
---
> h = httplib.HTTP(self.proxy)._conn
I have not tested whether or not this is a problem in Python3, but I'm
99% sure there's a similar issue @
http://docs.python.org/py3k/library/xmlrpc.client.html#example-of-client-usage.
Dirk
More information about the docs
mailing list