diff options
author | msapiro <> | 2006-02-23 06:25:29 +0000 |
---|---|---|
committer | msapiro <> | 2006-02-23 06:25:29 +0000 |
commit | 07b07babefa9d80a927e59293bed4ed22d0d4527 (patch) | |
tree | 53b2293d9c1734428ee39b454722375ce70b3b2b /Mailman | |
parent | bb774fb5f5faf9a44ab9b966d7da164b902e3c4f (diff) | |
download | mailman2-07b07babefa9d80a927e59293bed4ed22d0d4527.tar.gz mailman2-07b07babefa9d80a927e59293bed4ed22d0d4527.tar.xz mailman2-07b07babefa9d80a927e59293bed4ed22d0d4527.zip |
Improved fix for bug 1433673. When time.strptime returns tm_isdst = -1, use
time.localtime(time.mktime()) to try again.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/i18n.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Mailman/i18n.py b/Mailman/i18n.py index 890ecab6..7fe3b7ce 100644 --- a/Mailman/i18n.py +++ b/Mailman/i18n.py @@ -110,6 +110,10 @@ def ctime(date): year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date) if dst in (0,1): tzname = time.tzname[dst] + else: + # MAS: No exception but dst = -1 so try + return ctime(time.mktime((year, mon, day, hh, mm, ss, wday, + ydat, dst))) except (ValueError, AttributeError): try: wday, mon, day, hms, year = date.split() |