[Moin-user] Unable to stop this cretin

skip at pobox.com skip at pobox.com
Mon Oct 17 20:40:54 EDT 2005


    Nir> Then the best solution will be to investigate why antispam does not
    Nir> work on your system, since it seems that no other developer has
    Nir> time for this now.

    Skip> I'll try to take a look at this when I have a chance.

I poked around in antispam.py a little.  At line 121 there is an if
statement:

    if mydate < masterdate:

That comparison is between a datetime.datetime object (masterdate) and an
xmlrpclib.DateTime object (mydate).  My system has a version of xmlrpclib
that's more like what's going to be in 2.5.  It generates datetime objects
when possible. (*)

I fiddled around a bit, but couldn't figure out how to import Python's
datetime module from antispam.py without changing MoinMoin.  MoinMoin has a
datetime module in its utils package that obscures the core datetime module.
I wound up renaming it to datefuncs.py and changed all references.  Then in
antispam.py I checked the type of masterdate and set mydate accordingly:

        if isinstance(masterdate, datetime.datetime): 
            mydate = datetime.datetime(*tuple(time.gmtime(mymtime))[0:6])
        else:
            mydate = xmlrpclib.DateTime(tuple(time.gmtime(mymtime)))

I know that's crude, but it did get antispam.py working for me.

Skip

(*) It appears the datetime mods to xmlrpclib.py for 2.5 are going to cause
some compatibility problems if left as-is.  Now would be the time to test
MoinMoin against Python's CVS version (a.k.a. 2.5a0) and/or suggest ways the
xmlrpclib module might be modified in a more backwards-compatible way.




More information about the Moin-user mailing list