[Mailman-Developers] [Mailman-checkins] SF.net SVN: mailman: [8036]trunk/mailman/Mailman/loginit.py

Mark Sapiro msapiro at value.net
Fri Sep 22 15:40:52 CEST 2006


>Revision: 8036
>          http://svn.sourceforge.net/mailman/?rev=8036&view=rev
>Author:   tkikuchi
>Date:     2006-09-22 06:05:30 -0700 (Fri, 22 Sep 2006)
>
>Log Message:
>-----------
>I needed this for web ui to work.
>
>Modified Paths:
>--------------
>    trunk/mailman/Mailman/loginit.py
>
>Modified: trunk/mailman/Mailman/loginit.py
>===================================================================
>--- trunk/mailman/Mailman/loginit.py	2006-09-21 18:23:48 UTC (rev 8035)
>+++ trunk/mailman/Mailman/loginit.py	2006-09-22 13:05:30 UTC (rev 8036)
>@@ -25,6 +25,7 @@
> import logging
> 
> from Mailman.configuration import config
>+config.load()
> 
> FMT     = '%(asctime)s (%(process)d) %(message)s'
> DATEFMT = '%b %d %H:%M:%S %Y'
>
>


Yes, but this is not the proper fix. I think the place to put
config.load() for the web interface is in scripts/driver.

I sent the following to Barry a few weeks ago, but to date have seen no
reply.

----------- excerpt from message to Barry -------------------
Unfortunately, I neglected to report something else I saw because I
didn't have time to figure it out. I'm still not sure about this, but
here's the problem:

[msapiro at msapiro ...f/test-mailman]$ scripts/post
Traceback (most recent call last):
  File "scripts/post", line 48, in ?
    main()
  File "scripts/post", line 39, in main
    status = sys.modules[module_name].main()
  File "/cygdrive/f/test-mailman/Mailman/bin/post.py", line 44, in main
    loginit.initialize(propagate=True)
  File "/cygdrive/f/test-mailman/Mailman/loginit.py", line 119, in
initialize
    handler = ReopenableFileHandler(os.path.join(config.LOG_DIR,
logger))
AttributeError: 'Configuration' object has no attribute 'LOG_DIR'

In this case, nothing has called config.load(). The same problem exists
in the web interface. That can be fixed with

--- f:/MM-Trunk/mailman/scripts/driver  2006-05-16 20:09:56.437500000
-0700
+++ scripts/driver      2006-08-29 09:51:32.375000000 -0700
@@ -68,6 +68,8 @@
     log = None
     try:
         import paths
+        from Mailman.configuration import config
+        config.load()
         # When running in non-stealth mode, we need to escape entities,
         # otherwise we're vulnerable to cross-site scripting attacks.
         try:

but this then leads to other places where we try to sort the set
returned by Utils.list_names()

I can work on cleaning this up, but I'd like confirmation that
scripts/driver is the right place for config.load() and also what to
do about the various scripts invoked by the mail wrapper.
--------------------end excerpt-------------------------

The problem with calling config.load() from loginit is I think it will
override the loading of a alternate config which may have been
specified as a command line option for those commands that support it
(at least the ones that do logging too).

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Developers mailing list