------------------------------------------------------------ revno: 1690 fixes bug: https://launchpad.net/bugs/1664729 committer: Mark Sapiro <m...@msapiro.net> branch nick: 2.1 timestamp: Tue 2017-02-14 19:15:58 -0800 message: Catch NotAMemberError when member is removed before probe bounce returns. modified: Mailman/Queue/BounceRunner.py NEWS
-- lp:mailman/2.1 https://code.launchpad.net/~mailman-coders/mailman/2.1 Your team Mailman Checkins is subscribed to branch lp:mailman/2.1. To unsubscribe from this branch go to https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Queue/BounceRunner.py' --- Mailman/Queue/BounceRunner.py 2015-08-14 02:05:52 +0000 +++ Mailman/Queue/BounceRunner.py 2017-02-15 03:15:58 +0000 @@ -29,6 +29,7 @@ from Mailman import mm_cfg from Mailman import Utils from Mailman import LockFile +from Mailman.Errors import NotAMemberError from Mailman.Message import UserNotification from Mailman.Bouncer import _BounceInfo from Mailman.Bouncers import BouncerAPI @@ -151,19 +152,26 @@ mlist.Lock() try: op, addr, bmsg = mlist.pend_confirm(token) - info = mlist.getBounceInfo(addr) - if not info: - # info was deleted before probe bounce was received. - # Just create a new info. - info = _BounceInfo(addr, - 0.0, - time.localtime()[:3], - mlist.bounce_you_are_disabled_warnings - ) - mlist.disableBouncingMember(addr, info, bmsg) - # Only save the list if we're unlocking it - if not locked: - mlist.Save() + # For Python 2.4 compatibility we need an inner try because + # try: ... except: ... finally: requires Python 2.5+ + try: + info = mlist.getBounceInfo(addr) + if not info: + # info was deleted before probe bounce was received. + # Just create a new info. + info = _BounceInfo(addr, + 0.0, + time.localtime()[:3], + mlist.bounce_you_are_disabled_warnings + ) + mlist.disableBouncingMember(addr, info, bmsg) + # Only save the list if we're unlocking it + if not locked: + mlist.Save() + except NotAMemberError: + # Member was removed before probe bounce returned. + # Just ignore it. + pass finally: if not locked: mlist.Unlock() === modified file 'NEWS' --- NEWS 2017-02-04 06:20:11 +0000 +++ NEWS 2017-02-15 03:15:58 +0000 @@ -26,6 +26,9 @@ Bug fixes and other patches + - Fixed an uncaught NotAMemberError when a member is removed before a + probe bounce for the member is returned. (LP: #1664729) + - Fixed a TypeError thrown in the roster CGI when called with a listname containing a % character. (LP: #1661810)
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org