From 0c4fe6bada65d7101821031b808f887d8ec37851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= Date: Tue, 23 Oct 2012 20:05:59 +0200 Subject: [PATCH] Bugfix: make change_message_uid to update messagelist's filename This broke code that relied on the filename being up to date in memory after messages are copied. Signed-off-by: Eygene Ryabinkin --- offlineimap/folder/Maildir.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index 24d9ced..ba55e74 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -356,10 +356,12 @@ class MaildirFolder(BaseFolder): oldfilename = self.messagelist[uid]['filename'] dir_prefix, filename = os.path.split(oldfilename) flags = self.getmessageflags(uid) - filename = self.__new_message_filename(new_uid, flags) + newfilename = os.path.join(dir_prefix, + self.__new_message_filename(new_uid, flags)) os.rename(os.path.join(self.getfullname(), oldfilename), - os.path.join(self.getfullname(), dir_prefix, filename)) + os.path.join(self.getfullname(), newfilename)) self.messagelist[new_uid] = self.messagelist[uid] + self.messagelist[new_uid]['filename'] = newfilename del self.messagelist[uid] # Interface from BaseFolder