[Mailman-Developers] Bugs in weekly archiving - mailman 1.1?

Nigel Metheringham Nigel.Metheringham@vdata.co.uk
Tue, 01 Feb 2000 13:36:46 +0000


I have a problem that has shown up since I changed to mailman 1.1 (from 
1.0).  Coincidently the platform the system ran on was upgraded to RH 
6.1 linux (this was all due to a hardware failure) - I think this 
upgraded python and glibc.

Heavy traffic lists I archive on a weekly basis.  At the start of each 
month it produces invalid datestamps, ie today
	Week-of-Mon-20000200
	Week-of-Mon-200001-4
	Week-of-Mon-199912-1

In the source, Mailman/Archiver/HyperArch.py there is the code:-

        elif self.ARCHIVE_PERIOD == 'week':
            datetuple = list(datetuple)
            datetuple[2] = datetuple[2] - datetuple[6] # subtract week 
day
            #
            # even if the the day of the month counter is negative,
            # we still get the right thing from strftime! -scott
            #
            return time.strftime("Week-of-Mon-%Y%m%d", tuple(datetuple))

I've test bedded this code under perl (which I can write rather better) 
and the system/library strftime() behaves as "scott" says - so putting 
in the -4th of Jan 2000 gives strftime output of 27th Dec 1999.

I'm starting to wonder if python put a strftime implementation into its 
library functions which does not match these assumptions... although it 
does appear to link against one in the C libraries.  All in all I'm a 
tad confused over what is causing this problem.

I could work round this by changing that code to read
	    datetuple=time.gmtime(date - (datetuple[6] * 86400))

which will always work - although its more costly on CPU.  Its also 
working around a problem that should not be there :-)

	Nigel.
-- 
[ - Opinions expressed are personal and may not be shared by VData - ]
[ Nigel Metheringham                  Nigel.Metheringham@VData.co.uk ]
[ Phone: +44 1423 850000                         Fax +44 1423 858866 ]