Fix a python3 w/o lxml issue with binary serialization in the soap protocol

This commit is contained in:
Christophe de Vienne 2013-01-25 21:50:19 +01:00
parent ef71f6e392
commit 2f27d2b7fd

View File

@ -199,6 +199,8 @@ class SoapEncoder(object):
def binary_tosoap(self, datatype, tag, value):
print(datatype, tag, value)
value = base64.encodestring(value) if value is not None else None
if six.PY3:
value = value.decode('ascii')
return self.make_soap_element(
datatype.basetype, tag, value, 'xs:base64Binary'
)