VMM/mailbox: Decode error messages from doveadm. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Sat, 08 Dec 2012 14:48:30 +0000
branchv0.7.x
changeset 660 0bce7e1d1349
parent 659 a6b6b0937cae
child 662 9ec7770193ad
VMM/mailbox: Decode error messages from doveadm. Those errors occur only with the dbox mailbox format when the mailbox.folders contains non-ASCII mailbox names.
VirtualMailManager/mailbox.py
--- a/VirtualMailManager/mailbox.py	Mon Dec 03 19:19:52 2012 +0000
+++ b/VirtualMailManager/mailbox.py	Sat Dec 08 14:48:30 2012 +0000
@@ -14,6 +14,7 @@
 from binascii import a2b_base64, b2a_base64
 from subprocess import Popen, PIPE
 
+from VirtualMailManager import ENCODING
 from VirtualMailManager.account import Account
 from VirtualMailManager.common import lisdir
 from VirtualMailManager.errors import VMMError
@@ -257,7 +258,7 @@
         stderr = process.communicate()[1]
         if process.returncode:
             e_msg = _('Failed to create mailboxes: %r\n') % mailboxes
-            raise VMMError(e_msg + stderr.strip().decode(), VMM_ERROR)
+            raise VMMError(e_msg + stderr.strip().decode(ENCODING), VMM_ERROR)
 
     def create(self):
         """Create a dbox INBOX"""