Skip to content

Commit 3abd3a0

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent d51b826 commit 3abd3a0

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
@@ -11,6 +11,7 @@ Fixed:
1111
- fix some security assertions (sf bug 1085481) (see doc/upgrading.txt for
1212
notes)
1313
- don't set the title to nothing from incoming mail (thanks Bruce Guenter)
14+
- fix py2.4 strftime() API change bug (sf bug 1087746)
1415

1516

1617
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.68.2.4 2004-10-08 00:34:58 richard Exp $
18+
# $Id: date.py,v 1.68.2.5 2005-01-03 03:08:37 richard Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -361,8 +361,14 @@ def pretty(self, format='%d %B %Y'):
361361
Note that if the day is zero, and the day appears first in the
362362
format, then the day number will be removed from output.
363363
'''
364-
str = time.strftime(format, (self.year, self.month, self.day,
365-
self.hour, self.minute, int(self.second), 0, 0, 0))
364+
# Python2.4 strftime() enforces the non-zero-ness of the day-of-year
365+
# component of the time tuple, so we need to figure it out
366+
t = (self.year, self.month, self.day, self.hour, self.minute,
367+
int(self.second), 0, 0, 0)
368+
t = calendar.timegm(t)
369+
t = time.gmtime(t)
370+
str = time.strftime(format, t)
371+
366372
# handle zero day by removing it
367373
if format.startswith('%d') and str[0] == '0':
368374
return ' ' + str[1:]

0 commit comments

Comments
 (0)