From 131ac5c8276b7359d307073130406e64835b8f49 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Sun, 5 Aug 2012 22:40:52 +0400 Subject: [PATCH] IMAPlib mixin class: pass 'readonly' exception to our callers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will allow our callers who are capable of dealing with readonly folders to properly detect this condition and act accordingly. One example is Gmail's "Chats" folder that is read-only, but contains logs of the quick chats. Minor Changelog improvements. Tested-by: Abdó Roig-Maranges Signed-off-by: Eygene Ryabinkin Signed-off-by: Nicolas Sebrecht --- Changelog.rst | 14 +++++++------- offlineimap/imaplibutil.py | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Changelog.rst b/Changelog.rst index 30b58eb..4b31f39 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -8,17 +8,20 @@ ChangeLog WIP (add new stuff for the next release) ======================================== +* Learn to deal with readonly folders to properly detect this condition and act + accordingly. One example is Gmail's "Chats" folder that is read-only, + but contains logs of the quick chats. (E. Ryabinkin) * Fix str.format() calls for Python 2.6 (D. Logie) * Remove APPENDUID hack, previously introduced to fix Gmail, no longer necessary, it might have been breaking things. (J. Wiegley) OfflineIMAP v6.5.4 (2012-06-02) -================================= +=============================== * bump bundled imaplib2 library 2.29 --> 2.33 * Actually perform the SSL fingerprint check (reported by J. Cook) * Curses UI, don't use colors after we shut down curses already (C.Höger) -* Document that '%' needs encoding as '%%' in *.conf +* Document that '%' needs encoding as '%%' in configuration files. * Fix crash when IMAP.quickchanged() led to an Error (reported by sharat87) * Implement the createfolders setting to disable folder propagation (see docs) @@ -28,9 +31,6 @@ OfflineIMAP v6.5.3.1 (2012-04-03) * Don't fail if no dry-run setting exists in offlineimap.conf (introduced in 6.5.3) -* Don't fail if no dry-run setting exists in offlineimap.conf - (introduced in 6.5.3) - OfflineIMAP v6.5.3 (2012-04-02) =============================== @@ -67,7 +67,7 @@ OfflineIMAP v6.5.3 (2012-04-02) * Improve compatability of the curses UI with python 2.6 OfflineIMAP v6.5.2.1 (2012-04-04) -===================================== +================================= * Fix python2.6 compatibility with the TTYUI backend (crash) @@ -123,7 +123,7 @@ Smallish bug fixes that deserve to be put out. * Add filter information to the filter list in --info output OfflineIMAP v6.5.1.1 (2012-01-07) - "Das machine control is nicht fur gerfinger-poken und mittengrabben" -================================================================================================================== +======================================================================================================== Blinkenlights UI 6.5.0 regression fixes only. diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py index aa165f0..4290b2b 100644 --- a/offlineimap/imaplibutil.py +++ b/offlineimap/imaplibutil.py @@ -49,6 +49,9 @@ class UsefulIMAPMixIn(object): del self.untagged_responses[:] try: result = super(UsefulIMAPMixIn, self).select(mailbox, readonly) + except self.readonly as e: + # pass self.readonly to our callers + raise except self.abort as e: # self.abort is raised when we are supposed to retry errstr = "Server '%s' closed connection, error on SELECT '%s'. Ser"\