From bb5b1f2dcf0622b86808b6dab8bc067594b7303e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Fri, 28 Aug 2020 16:51:11 +0200 Subject: [PATCH] Encode folder name before md5 Avoid the error: Unicode-objects must be encoded before hashing --- 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 6a2a147..e245b30 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -74,7 +74,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()) # Modification time from 'Date' header.