[PATCH 07/15] Encode utf-8 argument for md5 function

Łukasz Żarnowiecki dolohow at outlook.com
Tue May 10 00:18:29 BST 2016


Python3 accepts binary input for md5 function.

Signed-off-by: Łukasz Żarnowiecki <dolohow at outlook.com>
---
 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 bda452a..95e2553 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()).hexdigest()
+        self._foldermd5 = md5(self.getvisiblename().encode('utf-8')).hexdigest()
         # Cache the full folder path, as we use getfullname() very often.
         self._fullname = os.path.join(self.getroot(), self.getname())
 
-- 
2.8.2





More information about the OfflineIMAP-project mailing list