Issue 2550802
Created on 2013-03-21 08:46 by nop-abc-se, last changed 2013-03-22 11:10 by ber.
msg4825 |
Author: [hidden] (nop-abc-se) |
Date: 2013-03-21 08:46 |
|
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.
|
msg4826 |
Author: [hidden] (ber) |
Date: 2013-03-21 21:21 |
|
Hi Erik,
thanks for the report and the suggestion to fix it.
Would you care for compiling a patch (with diff -u or so)
and a note for the Changes file and attach it here?
That would speed up our uptake of it. ;)
Best Regards,
Bernhard
|
msg4829 |
Author: [hidden] (nop-abc-se) |
Date: 2013-03-22 10:33 |
|
Find attached a proposed patch of date.py and CHANGES.txt.
|
msg4830 |
Author: [hidden] (ber) |
Date: 2013-03-22 11:10 |
|
4773:8ab5d7d63191
Thanks Erik!
|
|
Date |
User |
Action |
Args |
2013-03-22 11:10:29 | ber | set | status: new -> closed resolution: fixed messages:
+ msg4830 |
2013-03-22 10:33:11 | nop-abc-se | set | files:
+ roundup-issue2550802.patch keywords:
+ patch messages:
+ msg4829 |
2013-03-21 21:21:40 | ber | set | nosy:
+ ber messages:
+ msg4826 |
2013-03-21 08:46:25 | nop-abc-se | create | |
|