summaryrefslogtreecommitdiff
path: root/Mailman/MailList.py
diff options
context:
space:
mode:
authorbwarsaw2002-10-20 15:01:52 +0000
committerbwarsaw2002-10-20 15:01:52 +0000
commit8073edc7b37421b5536f6b70363169e333ecf4f1 (patch)
tree16c3f572f80a83f3baf8c490427cf2b37cbd6eeb /Mailman/MailList.py
parent4dd915d724b6c38e69af0b3b6fa786eb1623cf58 (diff)
downloadmailman-8073edc7b37421b5536f6b70363169e333ecf4f1.tar.gz
mailman-8073edc7b37421b5536f6b70363169e333ecf4f1.tar.zst
mailman-8073edc7b37421b5536f6b70363169e333ecf4f1.zip
__getstate__(), __setstate__(): Get rid of the lock object attribute
on both pickling and unpickling, for legacy archive pickles.
Diffstat (limited to 'Mailman/MailList.py')
-rw-r--r--Mailman/MailList.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 95c20e1aa..4376efd66 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -113,12 +113,23 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
if func:
func(self)
+ # Never pickle our lock object! We need both of these because MailLists
+ # get pickled by the archiver and this can cause ArchRunner to unlock
+ # lists at the wrong time. The real fix may be to not pickle MailList
+ # objects in the archiver, but that's too much work to verify at the
+ # moment.
+ LOCKATTR = '_MailList__lock'
+
def __getstate__(self):
d = self.__dict__.copy()
- # Never pickle our lock!
- del d['_MailList__lock']
+ del d[self.LOCKATTR]
return d
+ def __setstate__(self, d):
+ if d.has_key(self.LOCKATTR):
+ del d[self.LOCKATTR]
+ self.__dict__ = d
+
def __getattr__(self, name):
# Because we're using delegation, we want to be sure that attribute
# access to a delegated member function gets passed to the