diff --git a/Changelog.draft.rst b/Changelog.draft.rst index 76a0ea3..d9aa0bf 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -18,3 +18,8 @@ Changes Bug Fixes --------- + +* IMAP<->IMAP sync with a readonly local IMAP repository failed with a + rather mysterious "TypeError: expected a character buffer object" + error. Fix this my retrieving the list of folders early enough even + for readonly repositories. diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 71f08fe..d476b3e 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -265,6 +265,13 @@ class SyncableAccount(Account): remoterepos = self.remoterepos localrepos = self.localrepos statusrepos = self.statusrepos + + # init repos with list of folders, so we have them (and the + # folder delimiter etc) + remoterepos.getfolders() + localrepos.getfolders() + statusrepos.getfolders() + # replicate the folderstructure between REMOTE to LOCAL if not localrepos.getconfboolean('readonly', False): self.ui.syncfolders(remoterepos, localrepos)