aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authormsapiro <>2006-02-19 21:08:34 +0000
committermsapiro <>2006-02-19 21:08:34 +0000
commitc8a134d1b2d31877b64db8107c06fc61ddb93d23 (patch)
treeec19d392c41d62c6ee04af1e5a6b4a5f4dc0bd23 /Mailman
parentbfad4a96aa95c99d00a1bd4f120bd1c55a294664 (diff)
downloadmailman2-c8a134d1b2d31877b64db8107c06fc61ddb93d23.tar.gz
mailman2-c8a134d1b2d31877b64db8107c06fc61ddb93d23.tar.xz
mailman2-c8a134d1b2d31877b64db8107c06fc61ddb93d23.zip
Fixed bug 1433673 by fixing ctime() to not use time.tzname[1] when tm_isdst is -1.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/i18n.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Mailman/i18n.py b/Mailman/i18n.py
index 810f1566..890ecab6 100644
--- a/Mailman/i18n.py
+++ b/Mailman/i18n.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2003 by the Free Software Foundation, Inc.
+# Copyright (C) 2000-2006 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -12,7 +12,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
import sys
import time
@@ -107,7 +108,8 @@ def ctime(date):
if isinstance(date, StringType):
try:
year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date)
- tzname = time.tzname[dst and 1 or 0]
+ if dst in (0,1):
+ tzname = time.tzname[dst]
except (ValueError, AttributeError):
try:
wday, mon, day, hms, year = date.split()
@@ -132,7 +134,8 @@ def ctime(date):
break
else:
year, mon, day, hh, mm, ss, wday, yday, dst = time.localtime(date)
- tzname = time.tzname[dst and 1 or 0]
+ if dst in (0,1):
+ tzname = time.tzname[dst]
wday = daysofweek[wday]
mon = months[mon]