From 57e6eda61752715a91341d3c1fa0c6753d141e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Albert?= Date: Fri, 23 Sep 2016 15:48:55 +0200 Subject: [PATCH] Fix implicit call to unicode() from UI functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BaseFolder now exposes an __unicode__ method so that function needing unicode transcoding don't crash due to ascii encoding errors. Signed-off-by: Stéphane Albert Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 11fafe4..f0b9a11 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -98,6 +98,11 @@ class BaseFolder(object): # FIMXE: remove calls of this. We have getname(). return self.name + def __unicode__(self): + # NOTE(sheeprine): Implicit call to this by UIBase deletingflags() which + # fails if the str is utf-8 + return self.name.decode('utf-8') + @property def accountname(self): """Account name as string"""