From 2d885fda4c554f97a4dece434bf3101686c6053b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Albert?= Date: Mon, 31 Oct 2016 15:48:26 +0100 Subject: [PATCH] Fix md5 folder generation wanting unicode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using standard offlineimap without specific utf8 nametrans makes offlineimap crash when generating md5 of the folder because the foldername is already an str. Signed-off-by: Stéphane Albert Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Maildir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index 32e7092..e00e727 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -71,7 +71,7 @@ class MaildirFolder(BaseFolder): # Everything up to the first comma or colon (or ! if Windows): self.re_prefixmatch = re.compile('([^'+ self.infosep + ',]*)') # folder's md, so we can match with recorded file md5 for validity. - self._foldermd5 = md5(self.getvisiblename().encode('utf-8')).hexdigest() + self._foldermd5 = md5(self.getvisiblename()).hexdigest() # Cache the full folder path, as we use getfullname() very often. self._fullname = os.path.join(self.getroot(), self.getname()) # Modification time from 'Date' header.