Roundup Tracker - Issues

Message4825

Author nop-abc-se
Recipients nop-abc-se
Date 2013-03-21.08:46:24
Message-id <1363855585.57.0.0844007539669.issue2550802@psf.upfronthosting.co.za>
In-reply-to
Long description, and resolution:

I'm running a 1.4.21 tracker on sqlite-backend and web frontend behind apache.

After importing a bunch of issues of my custom class, one item view failed with the following 
templating error:
"""
<type 'exceptions.ValueError'>: second must be in 0..59
Debugging information follows
While evaluating the standard:'context/history' expression on line 61
"""

When dumping history on the command line I found one journal entry for the item with the 
Date 2013-03-19.13:07:60.000.
Note the bad seconds value.

Now date.py has a check on the seconds value on line 277 as follows:
            if str(self.second) == '60.0': self.second = 59.9

But when serialising the seconds field is stringified as '%06.3f'.

It is entirely possible that the line 277 check passes, but the format still yields '60.000', for 
instance for a float like 59.9999.

The fix is simply to alter the line 277 check to either if '%06.3f'%self.second == '60.000': ...
or in this instance a direct float value check of "if self.second > 59.999: ..." would suffice.

Also, the corrected value when the check fails should probably be 59.999 instead of the 
current 59.9.
History
Date User Action Args
2013-03-21 08:46:25nop-abc-sesetrecipients: + nop-abc-se
2013-03-21 08:46:25nop-abc-sesetmessageid: <1363855585.57.0.0844007539669.issue2550802@psf.upfronthosting.co.za>
2013-03-21 08:46:25nop-abc-selinkissue2550802 messages
2013-03-21 08:46:24nop-abc-secreate