[Mailman-Developers] .lower() for older pythons

Barry A. Warsaw barry@zope.com
Thu, 11 Jul 2002 17:20:13 -0400


>>>>> "MD" == Matt Domsch <Matt_Domsch@Dell.com> writes:

    MD> Thanks for this update.  I've run across one problem.  In
    MD> Mailman/MailCommandHandler.py, ParseMailCommands function:

    | +        precedence = msg.get('precedence', '').lower()
    | +        ack = msg.get('x-ack', '').lower()

    MD> With my python (1.5.2-30 as in Red Hat Linux 7.1), this
    MD> generates lots of errors in mailman/logs/error:

Damn!  It's really getting hard to keep Python 1.5.2 in mind. :(

    MD> I believe the proper fix is:

    MD> + precedence = string.lower(msg.get('precedence', '')) + ack =
    MD> string.lower(msg.get('x-ack', ''))

    MD> instead.  With this, it works and doesn't generate those
    MD> errors.  I'm not on mailman-developers, so please cc me on any
    MD> replies.

You're exactly right.  Attached is a patch.  I guess I have to
generate a 2.0.13. :(

-Barry

-------------------- snip snip --------------------
Index: MailCommandHandler.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Attic/MailCommandHandler.py,v
retrieving revision 1.70.2.1
diff -u -r1.70.2.1 MailCommandHandler.py
--- MailCommandHandler.py	2 Jul 2002 16:33:23 -0000	1.70.2.1
+++ MailCommandHandler.py	11 Jul 2002 21:16:47 -0000
@@ -120,8 +120,8 @@
         # of these clues, so there's little we can do to break loops in that
         # case, except throttle the number of responses sent to any one
         # requester in a day.  That's a job for MM2.1.
-        precedence = msg.get('precedence', '').lower()
-        ack = msg.get('x-ack', '').lower()
+        precedence = string.lower(msg.get('precedence', ''))
+        ack = string.lower(msg.get('x-ack', ''))
         beenthere = msg.get('x-beenthere', '')
         listid = msg.get('list-id', '')
         if (precedence in ('bulk', 'list', 'junk') or