summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-12-27 15:03:01 -0800
committerLance Stout <lancestout@gmail.com>2011-12-27 15:03:01 -0800
commitcd5ae944ec9756fb2f85fbb9a41261b7793b15ac (patch)
tree0c48afe55ef87072fbc8e7097ba3c64984e98975 /sleekxmpp
parent74e7e5a29194f7d0c382c7b5a9d0bc7127d431c6 (diff)
parente928b9c4341a7f49896ec13c1c4bf325ee708e00 (diff)
downloadslixmpp-cd5ae944ec9756fb2f85fbb9a41261b7793b15ac.tar.gz
slixmpp-cd5ae944ec9756fb2f85fbb9a41261b7793b15ac.tar.bz2
slixmpp-cd5ae944ec9756fb2f85fbb9a41261b7793b15ac.tar.xz
slixmpp-cd5ae944ec9756fb2f85fbb9a41261b7793b15ac.zip
Merge pull request #128 from correl/rpc_value_conversion_fix
XEP-0009 tests updated for Python3
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0009/binding.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/sleekxmpp/plugins/xep_0009/binding.py b/sleekxmpp/plugins/xep_0009/binding.py
index 2c54b3b1..b4395707 100644
--- a/sleekxmpp/plugins/xep_0009/binding.py
+++ b/sleekxmpp/plugins/xep_0009/binding.py
@@ -111,10 +111,10 @@ def _xml2py(value):
if value.find('{%s}double' % namespace) is not None:
return float(value.find('{%s}double' % namespace).text)
if value.find('{%s}base64' % namespace) is not None:
- return rpcbase64(value.find('{%s}base64' % namespace).text)
+ return rpcbase64(value.find('{%s}base64' % namespace).text.encode())
if value.find('{%s}Base64' % namespace) is not None:
# Older versions of XEP-0009 used Base64
- return rpcbase64(value.find('{%s}Base64' % namespace).text)
+ return rpcbase64(value.find('{%s}Base64' % namespace).text.encode())
if value.find('{%s}dateTime.iso8601' % namespace) is not None:
return rpctime(value.find('{%s}dateTime.iso8601' % namespace).text)
if value.find('{%s}struct' % namespace) is not None:
@@ -138,13 +138,13 @@ class rpcbase64(object):
self.data = data
def decode(self):
- return base64.decodestring(self.data)
+ return base64.b64decode(self.data)
def __str__(self):
- return self.decode()
+ return self.decode().decode()
def encoded(self):
- return self.data
+ return self.data.decode()