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.
The real fix is not to remove int() but to change it to long(). This is only needed if you run on Python 2.2. It works "as is" on Python >= 2.3.
Steps to reproduce
- install a fresh 1.3.1 on a Solaris/Sparc server
- create a new instance
go to the RecentChanges page
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
- Priority:
- Assigned to:
- Status: this is already fixed in tla