From c8a134d1b2d31877b64db8107c06fc61ddb93d23 Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Sun, 19 Feb 2006 21:08:34 +0000 Subject: Fixed bug 1433673 by fixing ctime() to not use time.tzname[1] when tm_isdst is -1. --- Mailman/i18n.py | 11 +++++++---- 1 file 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] -- cgit v1.2.3