diff options
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r-- | Lib/xmlrpc/client.py | 4 | ||||
-rw-r--r-- | Lib/xmlrpc/server.py | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 25e684f..bf42835 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -955,8 +955,6 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None, # standard XML-RPC wrappings if methodname: # a method call - if not isinstance(methodname, str): - methodname = methodname.encode(encoding) data = ( xmlheader, "<methodCall>\n" @@ -1422,7 +1420,7 @@ class ServerProxy: # call a method on the remote server request = dumps(params, methodname, encoding=self.__encoding, - allow_none=self.__allow_none).encode(self.__encoding) + allow_none=self.__allow_none).encode(self.__encoding, 'xmlcharrefreplace') response = self.__transport.request( self.__host, diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py index 304e218..5b5bf7c 100644 --- a/Lib/xmlrpc/server.py +++ b/Lib/xmlrpc/server.py @@ -269,7 +269,7 @@ class SimpleXMLRPCDispatcher: encoding=self.encoding, allow_none=self.allow_none, ) - return response.encode(self.encoding) + return response.encode(self.encoding, 'xmlcharrefreplace') def system_listMethods(self): """system.listMethods() => ['add', 'subtract', 'multiple'] @@ -622,7 +622,7 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer): response = dumps( Fault(1, "%s:%s" % (exc_type, exc_value)), encoding=self.encoding, allow_none=self.allow_none) - response = response.encode(self.encoding) + response = response.encode(self.encoding, 'xmlcharrefreplace') return response class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): |