Why this code doesn't work ?
#!/usr/bin/python2 from xmlrpclib import ServerProxy class ServerProxy1(ServerProxy): def __str__(self): return str(self.__host) proxy = ServerProxy1("http://workshop:58846/") print proxy
Original_str_:
def __repr__(self): return ( "" % (self.__host, self.__handler) ) __str__ = __repr__
Result:
File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: :method "_ServerProxy1__host.__str__" is not supported'>