Skip to content

Commit bec593d

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 6a28013 commit bec593d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Fixed:
6767
- fix roundup-admin find command handling of Multilinks
6868
- fix some security assertions (sf bug 1085481)
6969
- don't set the title to nothing from incoming mail (thanks Bruce Guenter)
70+
- fix py2.4 strftime() API change bug (sf bug 1087746)
7071

7172

7273
2004-10-26 0.7.9

roundup/date.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.77 2004-11-29 14:32:55 a1s Exp $
18+
# $Id: date.py,v 1.77.2.1 2005-01-03 03:06:30 richard Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -367,8 +367,14 @@ def pretty(self, format='%d %B %Y'):
367367
Note that if the day is zero, and the day appears first in the
368368
format, then the day number will be removed from output.
369369
'''
370-
str = time.strftime(format, (self.year, self.month, self.day,
371-
self.hour, self.minute, int(self.second), 0, 0, 0))
370+
# Python2.4 strftime() enforces the non-zero-ness of the day-of-year
371+
# component of the time tuple, so we need to figure it out
372+
t = (self.year, self.month, self.day, self.hour, self.minute,
373+
int(self.second), 0, 0, 0)
374+
t = calendar.timegm(t)
375+
t = time.gmtime(t)
376+
str = time.strftime(format, t)
377+
372378
# handle zero day by removing it
373379
if format.startswith('%d') and str[0] == '0':
374380
return ' ' + str[1:]

0 commit comments

Comments
 (0)