Merge lp:~barry/mailman/py26 into lp:mailman/2.1

Proposed by Barry Warsaw
Status: Merged
Merged at revision: not available
Proposed branch: lp:~barry/mailman/py26
Merge into: lp:mailman/2.1
To merge this branch: bzr merge lp:~barry/mailman/py26
Reviewer Review Type Date Requested Status
Mark Sapiro code Needs Fixing
Review via email: mp+1998@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Changes to make Mailman 2.1 compatible with Python 2.6. I've tested this with both 2.6 and 2.3 and it seems to work fine for me.

lp:~barry/mailman/py26 updated
1137. By Barry Warsaw

trunk

1138. By Barry Warsaw

Added NEWS entry

Revision history for this message
Barry Warsaw (barry) wrote :
Download full text (251.7 KiB)

=== modified file '.bzrignore'
--- .bzrignore 2008-06-06 18:13:09 +0000
+++ .bzrignore 2008-11-29 23:05:27 +0000
@@ -21,3 +21,6 @@
 src/rmlist
 src/roster
 src/subscribe
+Makefile
+*.mo
+autom4te.cache

=== modified file 'Mailman/Cgi/admin.py'
--- Mailman/Cgi/admin.py 2008-07-30 16:09:29 +0000
+++ Mailman/Cgi/admin.py 2008-11-29 23:05:27 +0000
@@ -24,7 +24,6 @@
 import os
 import re
 import cgi
-import sha
 import urllib
 import signal
 from types import *
@@ -41,6 +40,7 @@
 from Mailman.htmlformat import *
 from Mailman.Cgi import Auth
 from Mailman.Logging.Syslog import syslog
+from Mailman.Utils import sha_new

 # Set up i18n
 _ = i18n._
@@ -1269,7 +1269,7 @@
     confirm = cgidata.getvalue('confirmmodpw', '').strip()
     if new or confirm:
         if new == confirm:
- mlist.mod_password = sha.new(new).hexdigest()
+ mlist.mod_password = sha_new(new).hexdigest()
             # No re-authentication necessary because the moderator's
             # password doesn't get you into these pages.
         else:
@@ -1279,7 +1279,7 @@
     confirm = cgidata.getvalue('confirmpw', '').strip()
     if new or confirm:
         if new == confirm:
- mlist.password = sha.new(new).hexdigest()
+ mlist.password = sha_new(new).hexdigest()
             # Set new cookie
             print mlist.MakeCookie(mm_cfg.AuthListAdmin)
         else:

=== modified file 'Mailman/Cgi/create.py'
--- Mailman/Cgi/create.py 2007-11-25 08:04:30 +0000
+++ Mailman/Cgi/create.py 2008-11-29 23:05:32 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2008 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
@@ -21,7 +21,6 @@
 import os
 import signal
 import cgi
-import sha
 from types import ListType

 from Mailman import mm_cfg
@@ -31,6 +30,7 @@
 from Mailman import i18n
 from Mailman.htmlformat import *
 from Mailman.Logging.Syslog import syslog
+from Mailman.Utils import sha_new

 # Set up i18n
 _ = i18n._
@@ -180,7 +180,7 @@
         # Install the emergency shutdown signal handler
         signal.signal(signal.SIGTERM, sigterm_handler)

- pw = sha.new(password).hexdigest()
+ pw = sha_new(password).hexdigest()
         # Guarantee that all newly created files have the proper permission.
         # proper group ownership should be assured by the autoconf script
         # enforcing that all directories have the group sticky bit set

=== modified file 'Mailman/Errors.py'
--- Mailman/Errors.py 2005-08-27 01:40:17 +0000
+++ Mailman/Errors.py 2008-11-29 23:05:27 +0000
@@ -49,14 +49,13 @@
 class MMExpiredCookieError(MMCookieError): pass
 class MMInvalidCookieError(MMCookieError): pass

-# BAW: these still need to be converted to classes.
-MMMustDigestError = "MMMustDigestError"
-MMCantDigestError = "MMCantDigestError"
-MMNeedApproval = "MMNeedApproval"
-MMSubscribeNeedsConfirmation = "MMSubscribeNeedsConfirmation"
-MMBadConfirmation = "MMBadConfirmation"
-MMAlreadyDigested = "MMAlreadyDigested"
-MMAlreadyUndigested = "MMAlreadyUndige...

Revision history for this message
Mark Sapiro (msapiro) wrote :

So far, I've just eyeballed the diffs, but they look good with one exception. In configure.in, minimum Python version should be 2.4 as the sibling lists feature in CalcRecips.py uses sets.

Also, paths.py.in suppressed the string exception warning for python 2.5 with

    # Supress Python 2.5 warning about string exceptions.
    filterwarnings('ignore', '.* string exception', DeprecationWarning)

which can now be removed.

I still intend to do an actual build of the branch and test it.

review: Abstain (code)
Revision history for this message
Barry Warsaw (barry) wrote :
Download full text (159.3 KiB)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 30, 2008, at 01:22 AM, Mark Sapiro wrote:

>Vote: Abstain code
>So far, I've just eyeballed the diffs, but they look good with one exception. In configure.in, minimum Python version should be 2.4 as the sibling lists feature in CalcRecips.py uses sets.
>
>Also, paths.py.in suppressed the string exception warning for python 2.5 with
>
> # Supress Python 2.5 warning about string exceptions.
> filterwarnings('ignore', '.* string exception', DeprecationWarning)
>
>which can now be removed.
>
>I still intend to do an actual build of the branch and test it.

Cool, thanks for the comments. I've pushed an update to the branch, and here
is the incremental diff. It includes some autoconf cleanups.

- -Barry

=== modified file 'configure'
- --- configure 2008-11-04 02:25:20 +0000
+++ configure 2008-11-30 17:07:11 +0000
@@ -1,10 +1,10 @@
 #! /bin/sh
 # From configure.in Revision: 8122 .
 # Guess values for system-dependent variables and create Makefiles.
- -# Generated by GNU Autoconf 2.62.
+# Generated by GNU Autoconf 2.61.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -16,7 +16,7 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
- - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage. Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -38,45 +38,17 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits

- -as_nl='
- -'
- -export as_nl
- -# Printing a long string crashes Solaris 7 /usr/bin/printf.
- -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
- -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
- -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- - as_echo='printf %s\n'
- - as_echo_n='printf %s'
- -else
- - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- - as_echo_n='/usr/ucb/echo -n'
- - else
- - as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- - as_echo_n_body='eval
- - arg=$1;
- - case $arg in
- - *"$as_nl"*)
- - expr "X$arg" : "X\\(.*\\)$as_nl";
- - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- - esac;
- - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- - '
- - export as_echo_n_body
- - as_echo_n='sh -c $as_echo_n_body as_echo'
- - fi
- - export as_echo_body
- - as_echo='sh -c $as_echo_body as_echo'
- -fi
- -
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
- - PATH_SEPAR...

lp:~barry/mailman/py26 updated
1139. By Barry Warsaw

Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
deprecation warnings regarding string exceptions.

Revision history for this message
Mark Sapiro (msapiro) wrote :
Download full text (10.9 KiB)

I've now configured and made this branch with both Python 2.4.3 and Python 2.6. There is a problem. I've fixed it on my local branch, but I don't have permission to push it back.

The problem is that now that we accept an installed email library > 2.5.8, the several calls of the email message get_type() method either give a deprecation warning or throw an exception depending on email version. As I say, I fixed it on my copy of the branch, and I think we're ready to merge with this fix.

Here's the diff for these changes.

=== modified file 'Mailman/Bouncers/Caiwireless.py'
--- Mailman/Bouncers/Caiwireless.py 2005-08-27 01:40:17 +0000
+++ Mailman/Bouncers/Caiwireless.py 2008-12-01 01:32:51 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 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
@@ -27,7 +27,7 @@

 def process(msg):
- if msg.get_type() <> 'multipart/mixed':
+ if msg.get_content_type() <> 'multipart/mixed':
         return None
     # simple state machine
     # 0 == nothing seen

=== modified file 'Mailman/Bouncers/GroupWise.py'
--- Mailman/Bouncers/GroupWise.py 2008-06-15 19:39:31 +0000
+++ Mailman/Bouncers/GroupWise.py 2008-12-01 02:56:44 +0000
@@ -30,7 +30,7 @@

 def find_textplain(msg):
- if msg.get_type(msg.get_default_type()) == 'text/plain':
+ if msg.get_content_type() == 'text/plain':
         return msg
     if msg.is_multipart:
         for part in msg.get_payload():
@@ -44,7 +44,7 @@

 def process(msg):
- if msg.get_type() <> 'multipart/mixed' or not msg['x-mailer']:
+ if msg.get_content_type() <> 'multipart/mixed' or not msg['x-mailer']:
         return None
     if msg['x-mailer'][:3].lower() not in ('nov', 'ntm', 'int'):
         return None

=== modified file 'Mailman/Bouncers/Microsoft.py'
--- Mailman/Bouncers/Microsoft.py 2005-08-27 01:40:17 +0000
+++ Mailman/Bouncers/Microsoft.py 2008-12-01 01:33:09 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 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
@@ -25,7 +25,7 @@

 def process(msg):
- if msg.get_type() <> 'multipart/mixed':
+ if msg.get_content_type() <> 'multipart/mixed':
         return None
     # Find the first subpart, which has no MIME type
     try:

=== modified file 'Mailman/Bouncers/Netscape.py'
--- Mailman/Bouncers/Netscape.py 2005-08-27 01:40:17 +0000
+++ Mailman/Bouncers/Netscape.py 2008-12-01 01:33:37 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 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
@@ -61,7 +61,7 @@
     leaves = []
     flatten(msg, leaves)
     for i, subpart in zip(range(len(leaves)-1), leaves):
- if subpart.get_...

review: Needs Fixing (code)
Revision history for this message
Barry Warsaw (barry) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 30, 2008, at 10:33 PM, Mark Sapiro wrote:

> Vote: Needs Fixing code
> I've now configured and made this branch with both Python 2.4.3 and
> Python 2.6. There is a problem. I've fixed it on my local branch,
> but I don't have permission to push it back.
>
> The problem is that now that we accept an installed email library >
> 2.5.8, the several calls of the email message get_type() method
> either give a deprecation warning or throw an exception depending on
> email version. As I say, I fixed it on my copy of the branch, and I
> think we're ready to merge with this fix.
>
> Here's the diff for these changes.

These look good, thanks for testing them.

There are two ways we can handle the merge, depending on whether you
want to do it or you want me to do it.

If you want me to do it, then you should push your branch of my
original plus your changes to lp:~msapiro/mailman/<whatever>. Then
send me the link and I will merge that into my branch and commit it to
the 2.1 head.

Or, if you want to do it, then just take my original branch, merge
your changes into it, then merge /that/ branch into the 2.1 head,
commit, and push to lp:mailman/stable.

The former might be slightly better so that I can properly close out
the merge proposal and bug issue, but it's not really that big of a
deal either way.

Does that make sense?
- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkkzXNcACgkQ2YZpQepbvXGMEwCgpLTJ22hozWnShhJJdzAhu/6R
XwoAn1V/N3Xn8QmfAqUZgQ0eshzxMGLw
=9DTm
-----END PGP SIGNATURE-----

Revision history for this message
Mark Sapiro (msapiro) wrote :

> If you want me to do it, then you should push your branch of my
> original plus your changes to lp:~msapiro/mailman/<whatever>. Then
> send me the link and I will merge that into my branch and commit it to
> the 2.1 head.
>
> Or, if you want to do it, then just take my original branch, merge
> your changes into it, then merge /that/ branch into the 2.1 head,
> commit, and push to lp:mailman/stable.
>
> The former might be slightly better so that I can properly close out
> the merge proposal and bug issue, but it's not really that big of a
> deal either way.

I have pushed my changes to lp:~msapiro/mailman/py26. You can get them from there.

/Mark

Revision history for this message
Barry Warsaw (barry) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Dec 1, 2008, at 12:14 AM, Mark Sapiro wrote:

>> If you want me to do it, then you should push your branch of my
>> original plus your changes to lp:~msapiro/mailman/<whatever>. Then
>> send me the link and I will merge that into my branch and commit it
>> to
>> the 2.1 head.
>>
>> Or, if you want to do it, then just take my original branch, merge
>> your changes into it, then merge /that/ branch into the 2.1 head,
>> commit, and push to lp:mailman/stable.
>>
>> The former might be slightly better so that I can properly close out
>> the merge proposal and bug issue, but it's not really that big of a
>> deal either way.
>
> I have pushed my changes to lp:~msapiro/mailman/py26. You can get
> them from there.

Merged and push to the 2.1 branch.

Thanks!
- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkk0ulIACgkQ2YZpQepbvXE5VwCdHwvGXZc8jOXvHXGFPy9az1GQ
Z8sAni925/4VjYYSfc7XFiAvB2TxFj0S
=F/BP
-----END PGP SIGNATURE-----