- xml = xmlrpclib.dumps(sum(kwargs.iteritems(), args), cmd)
- self._debug_fn("calling ikiwiki procedure `%s': [%s]" % (cmd, xml))
- _IkiWikiExtPluginXMLRPCHandler._write(out_fd, xml)
+ xml = _xmlrpc_client.dumps(sum(kwargs.items(), args), cmd)
+ self._debug_fn(
+ "calling ikiwiki procedure `{0}': [{1}]".format(cmd, repr(xml)))
+ # ensure that encoded is a str (bytestring in Python 2, Unicode in 3)
+ if str is bytes and not isinstance(xml, str):
+ encoded = xml.encode('utf8')
+ else:
+ encoded = xml
+ _IkiWikiExtPluginXMLRPCHandler._write(out_fd, encoded)