pazz/alot — Issue #323: Tagging is impossible or hard right after using 'l' binding
Author: triumhiz
Created: 2012-02-11 13:27:41+00:00
State: open

Reproduce:
1) Find a thread with 'inbox' tag only (not required condition, just for example)
2) Press 'l', retag the thread with e.g. 'inbox,temp'
3) Press 's' trying to toggle 'unread' tag

Actual behavior:
list object has no attribute 'union'.
// or, sometimes, 'difference'
check the log for details

On pressing '@' at this moment 'unread' tag may appear.

Though really different results are possible.

Log:
DEBUG:__init__:mode:global got commandline "search tag:inbox AND NOT tag:killed"
DEBUG:__init__:ARGS: [u'search', u'tag:inbox', u'AND', u'NOT', u'tag:killed']
DEBUG:__init__:PARMS: {'sort': None, 'query': [u'tag:inbox', u'AND', u'NOT', u'tag:killed']}
DEBUG:__init__:cmd parms {'sort': None, 'query': [u'tag:inbox', u'AND', u'NOT', u'tag:killed'], 'prehook': None, 'posthook': None}
INFO:ui:setup gui in 256 colours
DEBUG:ui:fire first command
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "move down"
DEBUG:__init__:ARGS: [u'move', u'down']
DEBUG:__init__:PARMS: {'key': [u'down']}
DEBUG:__init__:cmd parms {'prehook': None, 'key': [u'down'], 'posthook': None}
DEBUG:ui:apply command:
DEBUG:__init__:mode:search got commandline "retagprompt"
DEBUG:__init__:ARGS: [u'retagprompt']
DEBUG:__init__:PARMS: {}
DEBUG:__init__:cmd parms {'prehook': None, 'posthook': None}
DEBUG:ui:apply command:
DEBUG:ui:apply command:
INFO:globals:open command shell
DEBUG:__init__:mode:global got commandline "compose"
DEBUG:__init__:ARGS: [u'compose']
DEBUG:__init__:PARMS: {'spawn': False, 'sender': None, 'attach': None, 'cc': None, 'omit_signature': False, 'bcc': None, 'to': None, 'template': None, 'subject': None}
DEBUG:__init__:cmd parms {'spawn': False, 'sender': None, 'attach': None, 'cc': None, 'omit_signature': False, 'prehook': None, 'bcc': None, 'to': None, 'template': None, 'posthook': None, 'subject': None}
DEBUG:__init__:mode:global got commandline "select"
DEBUG:__init__:ARGS: [u'select']
DEBUG:__init__:PARMS: {'key': 'select'}
DEBUG:__init__:cmd parms {'prehook': None, 'key': 'select', 'posthook': None}
DEBUG:ui:apply command:
DEBUG:globals:CMDLINE: retag inbox,temp
DEBUG:__init__:mode:search got commandline "retag inbox,temp"
DEBUG:__init__:ARGS: [u'retag', u'inbox,temp']
DEBUG:__init__:PARMS: {'action': 'set', 'tags': u'inbox,temp', 'flush': True}
DEBUG:__init__:cmd parms {'action': 'set', 'tags': u'inbox,temp', 'posthook': None, 'prehook': None, 'flush': True}
DEBUG:ui:apply command:
DEBUG:ui:apply command:
DEBUG:db:write-out item: ('set', , 'thread:0000000000000086', [u'inbox', u'temp'])
DEBUG:__init__:mode:search got commandline "toggletags unread"
DEBUG:__init__:ARGS: [u'toggletags', u'unread']
DEBUG:__init__:PARMS: {'action': 'toggle', 'tags': u'unread', 'flush': True}
DEBUG:__init__:cmd parms {'action': 'toggle', 'tags': u'unread', 'posthook': None, 'prehook': None, 'flush': True}
DEBUG:ui:apply command:
DEBUG:ui:apply command:
DEBUG:db:write-out item: ('tag', , 'thread:0000000000000086', [u'unread'])
DEBUG:ui:Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/alot/ui.py", line 465, in apply_command
d = defer.maybeDeferred(cmd.apply, self)
File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 133, in maybeDeferred
result = f(*args, **kw)
File "/usr/lib64/python2.7/site-packages/alot/commands/search.py", line 197, in apply
ui.apply_command(commands.globals.FlushCommand())
File "/usr/lib64/python2.7/site-packages/alot/ui.py", line 465, in apply_command
d = defer.maybeDeferred(cmd.apply, self)
--- ---
File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 133, in maybeDeferred
result = f(*args, **kw)
File "/usr/lib64/python2.7/site-packages/alot/commands/globals.py", line 354, in apply
ui.dbman.flush()
File "/usr/lib64/python2.7/site-packages/alot/db.py", line 153, in flush
afterwards()
File "/usr/lib64/python2.7/site-packages/alot/db.py", line 438, in myafterwards
self._tags = self._tags.union(tags)
exceptions.AttributeError: 'list' object has no attribute 'union'

DEBUG:__init__:mode:search got commandline "exit"
DEBUG:__init__:ARGS: [u'exit']
DEBUG:__init__:PARMS: {}
DEBUG:__init__:cmd parms {'prehook': None, 'posthook': None}
DEBUG:ui:apply command: