--- _strptime.py.orig 2010-07-12 08:55:53.000000000 -0400 +++ _strptime.py 2010-07-12 09:08:32.000000000 -0400 @@ -165,12 +165,17 @@ time.tzset() except AttributeError: pass + (no_saving, has_saving) = self._get_timezone() + self.timezone = (no_saving, has_saving) + + @classmethod + def _get_timezone(cls): no_saving = frozenset(["utc", "gmt", time.tzname[0].lower()]) if time.daylight: has_saving = frozenset([time.tzname[1].lower()]) else: has_saving = frozenset() - self.timezone = (no_saving, has_saving) + return (no_saving, has_saving) class TimeRE(dict): @@ -296,7 +301,8 @@ """Return a time struct based on the input string and the format string.""" global _TimeRE_cache, _regex_cache with _cache_lock: - if _getlang() != _TimeRE_cache.locale_time.lang: + locale_time = _TimeRE_cache.locale_time + if _getlang() != locale_time.lang or locale_time.timezone != locale_time._get_timezone(): _TimeRE_cache = TimeRE() _regex_cache.clear() if len(_regex_cache) > _CACHE_MAX_SIZE: