I found a solution!

Mark Sapiro deserves all the credit for helping me out a TON
=)

Here is my documentation in the hope that it will help someone in the future.



---------------------------


Mark writes:
The basic problem is that the python library or at least the one
containing the site-packages/ into which MySQLdb was installed is
/usr/lib64/python2.4 rather than /usr/lib/python2.4.

Mailman starts a lot of Python processes with the -S option which
bypasses importing the site module at startup and this is what
normally puts the path to site-packages in sys.path. Mailman attempts
to do this itself in its own paths module which everything imports,
but it assumes the path begins with /usr/lib/pythonv.v so it never got
/usr/lib64/python2.4/site-packages into sys.path.

The bit added to extend.py does this when it replaces the
MemberAdaptor, so MysqlMemberships can successfully import MySQLdb.



--------------------------
Aaron adds:

We changed extend.py to be:

import sys
if '/usr/lib64/python2.4/site-packages' not in sys.path:
    sys.path.append('/usr/lib64/python2.4/site-packages')

from Mailman.MysqlMemberships import MysqlMemberships

def extend(list):
        list._memberadaptor = MysqlMemberships(list)




--------------------------

To track down the fact that the module's directory was wrong we had to fix a 
bug in Mailman's error logging:

There is a bug in the error logging code in
/usr/local/cpanel/3rdparty/mailman/scripts/driver

Edit that file. Find

def print_environment(logfp=None):
    if logfp is None:
        logfp = sys.__stderr__

    try:
        import os
    except ImportError:
        os = None

    # Write some information about our Python executable to the log
file.
    print>>  logfp, '[----- Python Information -----]'
    print>>  logfp, 'sys.version     =', sys.version
    print>>  logfp, 'sys.executable  =', sys.executable
    print>>  logfp, 'sys.prefix      =', sys.prefix
    print>>  logfp, 'sys.exec_prefix =', sys.exec_prefix
    print>>  logfp, 'sys.path        =', sys.exec_prefix
    print>>  logfp, 'sys.platform    =', sys.platform


Change the next to last line of that from

    print>>  logfp, 'sys.path        =', sys.exec_prefix

to

    print>>  logfp, 'sys.path        =', sys.path

and then see what's reported for sys.path in the traceback.

---------------------------


Finally because my Cpanel installation of mailman was creating mailing lists that had 
"." in their name, and MySQL does not create tables with a period in the name I 
modified the code for MysqlMemberships.py

A global replace of

  self.__mlist.internal_name()

with

  self.__mlist.internal_name().replace('.', '_')









_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to