summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimotheus Pokorra (TBits.net) <tp@tbits.net>2013-10-16 11:56:50 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-16 11:56:50 +0200
commit05f6bf8d7ef033b70f9f9eb7fbccaba107b327e2 (patch)
tree004d2daab8ab2fd626e0b5284bdbb41b29c22f8f
parentc4a7765129a45f0c1e3ba32e53990270c129efe6 (diff)
downloadpykolab-05f6bf8d7ef033b70f9f9eb7fbccaba107b327e2.tar.gz
Properly encode output so it can be piped and redirected (#2254)
-rw-r--r--pykolab/cli/cmd_list_deleted_mailboxes.py2
-rw-r--r--pykolab/cli/cmd_list_mailbox_metadata.py2
-rw-r--r--pykolab/cli/cmd_list_mailboxes.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/pykolab/cli/cmd_list_deleted_mailboxes.py b/pykolab/cli/cmd_list_deleted_mailboxes.py
index 305a129..d39f890 100644
--- a/pykolab/cli/cmd_list_deleted_mailboxes.py
+++ b/pykolab/cli/cmd_list_deleted_mailboxes.py
@@ -75,7 +75,7 @@ def execute(*args, **kw):
mbox_parts = imap.parse_mailfolder(folder)
if not conf.raw:
- print "%s (Deleted at %s)" % (imap_utf7.decode(folder), datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16)))
+ print "%s (Deleted at %s)" % (imap_utf7.decode(folder).encode('utf-8'), datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16)))
else:
print "%s (Deleted at %s)" % (folder, datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16)))
diff --git a/pykolab/cli/cmd_list_mailbox_metadata.py b/pykolab/cli/cmd_list_mailbox_metadata.py
index a07420d..ac98283 100644
--- a/pykolab/cli/cmd_list_mailbox_metadata.py
+++ b/pykolab/cli/cmd_list_mailbox_metadata.py
@@ -83,7 +83,7 @@ def execute(*args, **kw):
metadata = []
folders = imap.list_folders(folder)
for folder in folders:
- print "Folder", folder
+ print "Folder", folder.encode('utf-8')
metadata = imap.get_metadata(folder)
diff --git a/pykolab/cli/cmd_list_mailboxes.py b/pykolab/cli/cmd_list_mailboxes.py
index f9391eb..d6be0ee 100644
--- a/pykolab/cli/cmd_list_mailboxes.py
+++ b/pykolab/cli/cmd_list_mailboxes.py
@@ -89,6 +89,6 @@ def execute(*args, **kw):
for folder in folders:
if not conf.raw:
- print imap_utf7.decode(folder)
+ print imap_utf7.decode(folder).encode('utf-8')
else:
print folder