[Mailman-Users] Archiving doesn't work under Mac OS X 10.1

Jon Carnes jonc at nc.rr.com
Sat Feb 22 22:36:20 CET 2003


The function is used only once in Mailman, inside i18n.py

  year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date)

You could easily replace this line of code with a small block that does
the same thing but without referencing the strptime function.

In fact, looking at the code, it looks like there is already an existing
block that would do this for you... Try deleting the 4 lines of code
that I marked with an * 

    if isinstance(date, StringType):
        try:
*            year, mon, day, hh, mm, ss, wday, ydat, dst = 
                time.strptime(date)
*            tzname = time.tzname[dst and 1 or 0]
*        except ValueError:
*            try:
                wday, mon, day, hms, year = date.split()
                hh, mm, ss = hms.split(':')
                year = int(year)
                day = int(day)
                hh = int(hh)
                mm = int(mm)
                ss = int(ss)
            except ValueError:
                return date
===
If that works then you won't need the time.strptime function at all.

Good Luck - Jon 

BTW: good detective work tracing down the lack of strptime function in
Max OSX v10.1!

On Sat, 2003-02-22 at 09:40, Peter Bengtson wrote:
> Some time ago, I reported that archiving doesn't work in Mailman 2.1.1 
> under Mac OS X 10.1. Every attempt to archive a message would result in 
> the following entry in 'logs/error':
> 
> > Feb 22 00:15:42 2003 (1950) SHUNTING: 
> > 1045869340.680055+e0e16d1c92bfc3454ac70ca2586b40b6f9ba5a4e
> > Feb 22 15:20:28 2003 (1950) Uncaught runner exception: 'module' object 
> > has no attribute 'strptime'
> > Feb 22 15:20:28 2003 (1950) Traceback (most recent call last):
> >   File "/Users/mailman/Mailman/Queue/Runner.py", line 105, in _oneloop
> >     self._onefile(msg, msgdata)
> >   File "/Users/mailman/Mailman/Queue/Runner.py", line 155, in _onefile
> >     keepqueued = self._dispose(mlist, msg, msgdata)
> >   File "/Users/mailman/Mailman/Queue/ArchRunner.py", line 73, in 
> > _dispose
> >     mlist.ArchiveMail(msg)
> >   File "/Users/mailman/Mailman/Archiver/Archiver.py", line 207, in 
> > ArchiveMail
> >     h.close()
> >   File "/Users/mailman/Mailman/Archiver/pipermail.py", line 304, in 
> > close
> >     self.update_dirty_archives()
> >   File "/Users/mailman/Mailman/Archiver/pipermail.py", line 518, in 
> > update_dirty_archives
> >     self.update_archive(i)
> >   File "/Users/mailman/Mailman/Archiver/HyperArch.py", line 1038, in 
> > update_archive
> >     self.__super_update_archive(archive)
> >   File "/Users/mailman/Mailman/Archiver/pipermail.py", line 424, in 
> > update_archive
> >     self._update_simple_index(hdr, archive, arcdir)
> >   File "/Users/mailman/Mailman/Archiver/pipermail.py", line 434, in 
> > _update_simple_index
> >     self.write_index_header()
> >   File "/Users/mailman/Mailman/Archiver/HyperArch.py", line 955, in 
> > write_index_header
> >     print self.html_head()
> >   File "/Users/mailman/Mailman/Archiver/HyperArch.py", line 640, in 
> > html_head
> >     d = {"listname": html_quote(mlist.real_name, self.lang),
> >   File "/Users/mailman/Mailman/Archiver/HyperArch.py", line 638, in 
> > quotetime
> >     return html_quote(i18n.ctime(s), self.lang)
> >   File "/Users/mailman/Mailman/i18n.py", line 98, in ctime
> >     year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date)
> > AttributeError: 'module' object has no attribute 'strptime'
> 
> Further research shows that the offending function, strptime, doesn't 
> exist in Mac OS X 10.1 - the function isn't defined, which causes 
> HAVE_STRPTIME to become undefined by ./configure. (I don't know the 
> situation under 10.2.). Doing a
> 
> 	python
> 	import time
> 	time.strptime
> 
> results in an error message, saying that strptime is an unknown entity.
> 
> At first I thought this might be a bug which only showed up when 
> archiving was set to something else than the distribution defaults, but 
> changing or removing the date clobbering settings in mm_cfg.py didn't 
> improve the situation. All archiving still seems to break.
> 
> A clean install of Python (2.2.2) doesn't improve the situation, either.
> 
> If 'strptime' is unavailable in 10.1, then all Mailman users under Mac 
> OS X 10.1 wouldn't be able to archive any messages at all. Are there 
> very few users on Mac OS X, or don't people generally use automatic 
> archiving? I would be interested to hear from anybody who has got it to 
> work under Mailman 2.x and Mac OS X 10.1.
> 
> Archiving used to work flawlessly - I have quite extensive archives 
> produced by a now defunct mailing list - but in one of the later 
> versions, presumable where the archiving routines were rewritten or 
> updated, it stopped working.
> 
> Should Mailman assume that 'strptime' is available? Is there a 
> workaround?
> 
> Any ideas or pointers most welcome.
> 
> 	/ Peter Bengtson
> 
> 
> ------------------------------------------------------
> Mailman-Users mailing list
> Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
> Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
> 
> This message was sent to: jonc at nc.rr.com
> Unsubscribe or change your options at
> http://mail.python.org/mailman/options/mailman-users/jonc%40nc.rr.com





More information about the Mailman-Users mailing list