Commit dd8ff984 authored by Łukasz Nowak's avatar Łukasz Nowak

squash! taskdistribution: Wrap in xmlrpclib.Binary if needed

Support unicode, by encoding them.
parent b029d555
...@@ -97,8 +97,10 @@ def patchRPCParser(error_handler): ...@@ -97,8 +97,10 @@ def patchRPCParser(error_handler):
def binarize_args(arg): def binarize_args(arg):
# Converts recursively basestring arg into Binary # Converts recursively basestring arg into Binary
if isinstance(arg, unicode):
arg = arg.encode('utf-8')
if isinstance(arg, basestring): if isinstance(arg, basestring):
return xmlrpclib.Binary(arg.encode('utf-8')) return xmlrpclib.Binary(arg)
if isinstance(arg, (list, tuple)): if isinstance(arg, (list, tuple)):
return map(binarize_args, arg) return map(binarize_args, arg)
if isinstance(arg, dict): if isinstance(arg, dict):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment