VirtualMailManager/mailbox.py
branchv0.7.x
changeset 643 df1e3b67882a
parent 642 4cd9d0a9f42f
child 653 cf07e4468934
--- a/VirtualMailManager/mailbox.py	Sun Nov 11 16:53:52 2012 +0000
+++ b/VirtualMailManager/mailbox.py	Tue Nov 20 13:40:32 2012 +0000
@@ -35,7 +35,7 @@
 
 
 def _mbase64_to_unicode(mb64):
-    return unicode(a2b_base64(mb64.replace(',', '/') + '==='), 'utf-16be')
+    return str(a2b_base64(mb64.replace(',', '/') + '==='), 'utf-16be')
 
 
 def utf8_to_mutf7(src):
@@ -86,7 +86,7 @@
 class Mailbox(object):
     """Base class of all mailbox classes."""
     __slots__ = ('_boxes', '_root', '_sep', '_user')
-    FILE_MODE = 0600
+    FILE_MODE = 0o600
     _ctrl_chr_re = re.compile('[\x00-\x1F\x7F-\x9F]')
     _box_name_re = re.compile('^[\x20-\x25\x27-\x7E]+$')
 
@@ -255,7 +255,7 @@
         process = Popen(cmd_args, stderr=PIPE)
         stderr = process.communicate()[1]
         if process.returncode:
-            e_msg = _(u'Failed to create mailboxes: %r\n') % mailboxes
+            e_msg = _('Failed to create mailboxes: %r\n') % mailboxes
             raise VMMError(e_msg + stderr.strip(), VMM_ERROR)
 
     def create(self):