aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2014-02-20 07:33:52 -0800
committerMark Sapiro <msapiro@value.net>2014-02-20 07:33:52 -0800
commit1df678c0f409c3e76d0b2e187624d428deee4a68 (patch)
tree5cf921112dad4cc21a16bc34ee8db58cca6bab54
parent37bc0d0aa423d5eab5387cabb188de62d263d76f (diff)
downloadmailman2-1df678c0f409c3e76d0b2e187624d428deee4a68.tar.gz
mailman2-1df678c0f409c3e76d0b2e187624d428deee4a68.tar.xz
mailman2-1df678c0f409c3e76d0b2e187624d428deee4a68.zip
- Fixed a bug in ListAdmin._handlepost that would crash when trying to
preserve a held message for the site admin if HOLD_MESSAGES_AS_PICKLES is False. (LP: #1282365)
-rwxr-xr-xMailman/ListAdmin.py15
-rwxr-xr-xNEWS4
2 files changed, 15 insertions, 4 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index af579331..28be4c7d 100755
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2011 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2014 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -243,7 +243,11 @@ class ListAdmin:
if e.errno <> errno.ENOENT: raise
return LOST
try:
- msg = cPickle.load(fp)
+ if path.endswith('.pck'):
+ msg = cPickle.load(fp)
+ else:
+ assert path.endswith('.txt'), '%s not .pck or .txt' % path
+ msg = fp.read()
finally:
fp.close()
# Save the plain text to a .msg file, not a .pck file
@@ -252,8 +256,11 @@ class ListAdmin:
outpath = head + '.msg'
outfp = open(outpath, 'w')
try:
- g = Generator(outfp)
- g.flatten(msg, 1)
+ if path.endswith('.pck'):
+ g = Generator(outfp)
+ g.flatten(msg, 1)
+ else:
+ outfp.write(msg)
finally:
outfp.close()
# Now handle updates to the database
diff --git a/NEWS b/NEWS
index 87991ccc..52536922 100755
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,10 @@ Here is a history of user visible changes to Mailman.
Bug Fixes and other patches
+ - Fixed a bug in ListAdmin._handlepost that would crash when trying to
+ preserve a held message for the site admin if HOLD_MESSAGES_AS_PICKLES
+ is False. (LP: #1282365)
+
- The from_is_list header munging feature introduced in Mailman 2.1.16 is
no longer erroneously applied to Mailman generated notices.
(LP: #1279667)