offlineimap stops working on 6.3.3 -> 6.4.2 upgrade

Sean Whitton sean at silentflame.com
Sat Dec 17 21:56:54 GMT 2011


Hello,

I just upgraded offlineimap from 6.3.3 to 6.4.2.  On an attempt to sync I
am now getting this error:

,----
|  ERROR: Syncing folder drafts [acc: Nucifera]
|   unsupported operand type(s) for -: 'list' and 'set'
|  ERROR: ERROR in syncfolder for Nucifera folder drafts: Traceback (most
recent call last):
|   File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line
406, in syncfolder
|     remotefolder.syncmessagesto(localfolder, statusfolder)
|   File "/usr/lib/python2.7/site-packages/offlineimap/folder/Base.py",
line 452, in syncmessagesto
|     action(dstfolder, statusfolder)
|   File "/usr/lib/python2.7/site-packages/offlineimap/folder/Base.py",
line 394, in syncmessagesto_flags
|     addflags = selfflags - statusflags
| TypeError: unsupported operand type(s) for -: 'list' and 'set'
`----

I see this lots of time and then hit C-c.

This is my config file:

,----
| [general]
| accounts = Nucifera
| pythonfile = .offlineimap.py
|
| [Account Nucifera]
| localrepository = NuciferaLocal
| remoterepository = NuciferaRemote
| # autorefresh = 5
| postsynchook = notmuch new
|
| [Repository NuciferaLocal]
| type = IMAP
| preauthtunnel = MAIL=maildir:$HOME/.gnus.d/Maildir /usr/lib/dovecot/imap
| holdconnectionopen = yes
|
| [Repository NuciferaRemote]
| type = IMAP
| remotehost = 10.9.8.1
| remoteuser = HIDDEN
| remotepass = HIDDEN
| ssl = yes
| #nametrans = lambda name: re.sub('^INBOX.', '', name)
| nametrans = lambda foldername: re.sub('.INBOX', '.', foldername)
| folderfilter = lambda foldername: foldername not in ['oldmail',
'mairix', 'lists.Org-mode', 'lists.WMExternal', 'lists.WMInternal',
'lists.WMOther', 'lists.WMProjects', 'spam']
| # folderfilter = lambda name: name in [ 'INBOX.important', 'INBOX.work' ]
| # folderfilter = lambda name: not (name in [ 'INBOX.spam',
'INBOX.commits' ])
| # holdconnectionopen = yes
| maxconnections = 3
| # foldersort = lld_cmp
`----

This is my python file:

,----
| # Propagate gnus-expire flag
| from offlineimap import imaputil
|
| def lld_flagsimap2maildir(flagstring):
|   flagmap = {'\\seen': 'S',
|              '\\answered': 'R',
|              '\\flagged': 'F',
|              '\\deleted': 'T',
|              '\\draft': 'D',
|              'gnus-expire': 'E',
|              'gnus-dormant': 'Q',
|              'gnus-forward': 'W',
|              'gnus-save': 'V'}
|   retval = []
|   imapflaglist = [x.lower() for x in flagstring[1:-1].split()]
|   for imapflag in imapflaglist:
|       if flagmap.has_key(imapflag):
|           retval.append(flagmap[imapflag])
|   retval.sort()
|   return retval
|
| def lld_flagsmaildir2imap(list):
|   flagmap = {'S': '\\Seen',
|              'R': '\\Answered',
|              'F': '\\Flagged',
|              'T': '\\Deleted',
|              'D': '\\Draft',
|              'E': 'gnus-expire',
|              'Q': 'gnus-dormant',
|              'W': 'gnus-forward',
|              'V': 'gnus-save'}
|   retval = []
|   for mdflag in list:
|       if flagmap.has_key(mdflag):
|           retval.append(flagmap[mdflag])
|   retval.sort()
|   return '(' + ' '.join(retval) + ')'
|
| imaputil.flagsmaildir2imap = lld_flagsmaildir2imap
| imaputil.flagsimap2maildir = lld_flagsimap2maildir
|
| # Grab some folders first, and archives later
| high = ['^important$', '^work$']
| low = ['^archives', '^spam$']
| import re
|
| def lld_cmp(x, y):
|   for r in high:
|       xm = re.search (r, x)
|       ym = re.search (r, y)
|       if xm and ym:
|           return cmp(x, y)
|       elif xm:
|           return -1
|       elif ym:
|           return +1
|   for r in low:
|       xm = re.search (r, x)
|       ym = re.search (r, y)
|       if xm and ym:
|           return cmp(x, y)
|       elif xm:
|           return +1
|       elif ym:
|           return -1
|   return cmp(x, y)
`----

My guess is that my python file needs changing somehow to support the new
version?

Any help appreciated.

Thanks.

S






More information about the OfflineIMAP-project mailing list