Description

On Solaris on Sparc you can have a usec value too long to be converted from a long to an int. The macro RecentChanges in v1.3.1 tries to cast a usec value to int at one point; removing the cast seems to fix it.

Steps to reproduce

  1. install a fresh 1.3.1 on a Solaris/Sparc server
  2. create a new instance
  3. go to the RecentChanges page

  4. get a backtrace pointing to an overflow error while converting int to long at line 86 of $PREFIX/lib/pythonX.Y/site-packages/MoinMoin/macro/RecentChanges.py

Example

[[RecentChanges]]

Details

MoinMoin Version

1.3.1

OS and Version

Solaris 9 on Sparc

Python Version

2.2.1

Server Setup

Apache 1.3

Server Details

CGI invocation

Workaround

Apply the following patch to $PREFIX/lib/pythonX.Y/site-packages/MoinMoin/macro/RecentChanges.py:

@@ -83,7 +83,7 @@ def format_page_edits(macro, lines, book
     # print time of change
     d['time_html'] = None
     if request.cfg.changed_time_fmt:
-        tdiff = long(tnow - wikiutil.version2timestamp(int(line.ed_time_usecs))) / 60 # has to be long for py 2.2.x
+        tdiff = long(tnow - wikiutil.version2timestamp(long(line.ed_time_usecs))) / 60 # has to be long for py 2.2.x
         if tdiff < 1440:
             d['time_html'] = _("%(hours)dh %(mins)dm ago") % {
                 'hours': int(tdiff/60), 'mins': tdiff%60}

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/RecentChangesMacroOnSolaris (last edited 2007-10-29 19:09:49 by localhost)