Issue #26147: xmlrpc now works with strings not encodable with used
non-UTF-8 encoding.
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 @@
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 @@
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):