From 9f78b088be2077752b9135b3788d51ba665a47bc Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Sun, 19 Feb 2012 17:35:28 +0400 Subject: [PATCH 1/2] Imaplib2: work around the Python bug 3473 It was not possible to pass anything, but (*args, **kwargs) before the following bug was fixed, http://bugs.python.org/issue3473 so we can't say (*args, key1 = value1, key2 = value2), but we should pack keys and values to the dictionary and pass it as '**kwargs'. Not every Python 2.6 has bug 3473 fixed, so we should work around it in our code. Signed-off-by: Eygene Ryabinkin --- offlineimap/imaplib2.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py index ffa2676..ed978be 100644 --- a/offlineimap/imaplib2.py +++ b/offlineimap/imaplib2.py @@ -1591,7 +1591,9 @@ class IMAP4(object): def _simple_command(self, name, *args, **kw): if 'callback' in kw: - self._command(name, *args, callback=self._command_completer, cb_arg=kw, cb_self=True) + # http://bugs.python.org/issue3473 + kwargs = {'callback':self._command_completer, 'cb_arg':kw, 'cb_self':True} + self._command(name, *args, **kwargs) return (None, None) return self._command_complete(self._command(name, *args), kw) -- 1.7.9