Fix md5 folder generation wanting unicode

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 <sheeprine@oh.its.fake.nullplace.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Stéphane Albert 2016-10-31 15:48:26 +01:00 committed by Nicolas Sebrecht
parent a92816bd6d
commit 2d885fda4c

View File

@ -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.