diff options
author | David Planella <david.planella@gmail.com> | 2008-11-22 21:32:49 +0100 |
---|---|---|
committer | David Planella <david.planella@gmail.com> | 2008-11-22 21:32:49 +0100 |
commit | 85aae3995be31a5f10cf65235f15038dbdcdb261 (patch) | |
tree | 38d0ed32dee807f463656fcb98cf579ce952fc6a /Mailman/ListAdmin.py | |
parent | 9476341ddf99f5a5138c2dc81c84a797b2c81579 (diff) | |
parent | f0d392172bb2400927948004d2dc66c264ca2aa5 (diff) | |
download | mailman2-85aae3995be31a5f10cf65235f15038dbdcdb261.tar.gz mailman2-85aae3995be31a5f10cf65235f15038dbdcdb261.tar.xz mailman2-85aae3995be31a5f10cf65235f15038dbdcdb261.zip |
Merged from upstream (lp:mailman/stable)
Upgraded the repository format with 'bzr upgrade'
Diffstat (limited to 'Mailman/ListAdmin.py')
-rw-r--r-- | Mailman/ListAdmin.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index 191b76f8..ec1307ac 100644 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -538,7 +538,21 @@ class ListAdmin: except IOError, e: if e.errno <> errno.ENOENT: raise self.__db = {} - for id, (op, info) in self.__db.items(): + for id, x in self.__db.items(): + # A bug in versions 2.1.1 through 2.1.11 could have resulted in + # just info being stored instead of (op, info) + if len(x) == 2: + op, info = x + elif len(x) == 6: + # This is the buggy info. Check for digest flag. + if x[4] in (0, 1): + op = SUBSCRIPTION + else: + op = HELDMSG + self.__db[id] = op, x + continue + else: + assert False, 'Unknown record format in %s' % self.__filename if op == SUBSCRIPTION: if len(info) == 4: # pre-2.1a2 compatibility @@ -553,7 +567,8 @@ class ListAdmin: assert len(info) == 6, 'Unknown subscription record layout' continue # Here's the new layout - self.__db[id] = when, addr, fullname, passwd, digest, lang + self.__db[id] = op, (when, addr, fullname, passwd, + digest, lang) elif op == HELDMSG: if len(info) == 5: when, sender, subject, reason, text = info @@ -562,7 +577,8 @@ class ListAdmin: assert len(info) == 6, 'Unknown held msg record layout' continue # Here's the new layout - self.__db[id] = when, sender, subject, reason, text, msgdata + self.__db[id] = op, (when, sender, subject, reason, + text, msgdata) # All done self.__closedb() |