summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0231/stanza.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-01-09 22:13:44 -0800
committerLance Stout <lancestout@gmail.com>2013-01-09 22:13:44 -0800
commit7b45245b1dd557b9dea98fdcce96d1f8f2a2771d (patch)
tree3cd8b7f0e25b93427247380084a15c45a986c039 /sleekxmpp/plugins/xep_0231/stanza.py
parentb07f1b3bd3dc7b50cd630b8b411bd0a499d801d0 (diff)
downloadslixmpp-7b45245b1dd557b9dea98fdcce96d1f8f2a2771d.tar.gz
slixmpp-7b45245b1dd557b9dea98fdcce96d1f8f2a2771d.tar.bz2
slixmpp-7b45245b1dd557b9dea98fdcce96d1f8f2a2771d.tar.xz
slixmpp-7b45245b1dd557b9dea98fdcce96d1f8f2a2771d.zip
Fix sending BOB data in Python3
Diffstat (limited to 'sleekxmpp/plugins/xep_0231/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0231/stanza.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/plugins/xep_0231/stanza.py b/sleekxmpp/plugins/xep_0231/stanza.py
index a51f5a03..8bf0d6ee 100644
--- a/sleekxmpp/plugins/xep_0231/stanza.py
+++ b/sleekxmpp/plugins/xep_0231/stanza.py
@@ -7,9 +7,10 @@
See the file LICENSE for copying permission.
"""
+import base64
-from base64 import b64encode, b64decode
+from sleekxmpp.util import bytes
from sleekxmpp.xmlstream import ElementBase
@@ -26,10 +27,10 @@ class BitsOfBinary(ElementBase):
self._set_attr('max-age', value)
def get_data(self):
- return b64decode(self.xml.text)
+ return base64.b64decode(bytes(self.xml.text))
def set_data(self, value):
- self.xml.text = b64encode(value)
+ self.xml.text = bytes(base64.b64encode(value)).decode('utf-8')
def del_data(self):
self.xml.text = ''