VirtualMailManager/mailbox.py
branchv0.7.x
changeset 653 cf07e4468934
parent 643 df1e3b67882a
child 660 0bce7e1d1349
--- a/VirtualMailManager/mailbox.py	Sun Nov 25 14:37:09 2012 +0000
+++ b/VirtualMailManager/mailbox.py	Sun Nov 25 17:06:17 2012 +0000
@@ -29,13 +29,14 @@
 
 def _mbase64_encode(inp, dest):
     if inp:
-        mb64 = b2a_base64(''.join(inp).encode('utf-16be'))
+        mb64 = b2a_base64(''.join(inp).encode('utf-16be')).decode()
         dest.append('&%s-' % mb64.rstrip('\n=').replace('/', ','))
         del inp[:]
 
 
 def _mbase64_to_unicode(mb64):
-    return str(a2b_base64(mb64.replace(',', '/') + '==='), 'utf-16be')
+    return str(a2b_base64(mb64.replace(',', '/').encode() + b'==='),
+               'utf-16be')
 
 
 def utf8_to_mutf7(src):
@@ -256,7 +257,7 @@
         stderr = process.communicate()[1]
         if process.returncode:
             e_msg = _('Failed to create mailboxes: %r\n') % mailboxes
-            raise VMMError(e_msg + stderr.strip(), VMM_ERROR)
+            raise VMMError(e_msg + stderr.strip().decode(), VMM_ERROR)
 
     def create(self):
         """Create a dbox INBOX"""