aboutsummaryrefslogtreecommitdiff
path: root/plugins/proxy.py
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat@koumbit.org>2013-11-29 19:01:30 -0500
committerAntoine Beaupré <anarcat@koumbit.org>2014-02-03 20:13:28 -0500
commit154c4ea9e65d033756330a7f8c5c0fa285380bf0 (patch)
tree5136ccf7d5fe31d4255659234c5ca63bdb2f9119 /plugins/proxy.py
parent8e458bd659bcc0693e13e7675b221f3c098f000b (diff)
downloadikiwiki-154c4ea9e65d033756330a7f8c5c0fa285380bf0.tar
ikiwiki-154c4ea9e65d033756330a7f8c5c0fa285380bf0.tar.gz
properly encode and decode from/to utf8 when sending rpc to ikiwiki
somehow, in receive this is not necessary/possible because the xml library expects strings and not unicode
Diffstat (limited to 'plugins/proxy.py')
-rwxr-xr-xplugins/proxy.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/proxy.py b/plugins/proxy.py
index ca731301f..d70a967a5 100755
--- a/plugins/proxy.py
+++ b/plugins/proxy.py
@@ -159,11 +159,11 @@ class _IkiWikiExtPluginXMLRPCHandler(object):
xml = _xmlrpc_client.dumps(sum(kwargs.items(), args), cmd)
self._debug_fn(
"calling ikiwiki procedure `{0}': [{1}]".format(cmd, xml))
- _IkiWikiExtPluginXMLRPCHandler._write(out_fd, xml)
+ _IkiWikiExtPluginXMLRPCHandler._write(out_fd, xml.encode('utf8'))
self._debug_fn('reading response from ikiwiki...')
- xml = _IkiWikiExtPluginXMLRPCHandler._read(in_fd)
+ xml = _IkiWikiExtPluginXMLRPCHandler._read(in_fd).decode('utf8')
self._debug_fn(
'read response to procedure {0} from ikiwiki: [{1}]'.format(
cmd, xml))
@@ -250,7 +250,7 @@ class IkiWikiProcedureProxy(object):
# kwargs = dict([args[i:i+2] for i in xrange(1, len(args), 2)])
ret = function(self, *args)
self._debug_fn(
- "{0} hook `{1}' returned: [{2}]".format(type, name, ret))
+ "{0} hook `{1}' returned: [{2}]".format(type, name, repr(ret)))
if ret == IkiWikiProcedureProxy._IKIWIKI_NIL_SENTINEL:
raise InvalidReturnValue(
'hook functions are not allowed to return {0}'.format(