I\'m having a very weird problem with Python\'s pytz
: it seems to have an incomplete catalog of timezones on my system (MacOS X 10.8.5, system Python 2.7.5).
Tried reinstall, but bug not gone.
Then, I open pytz/__init__.py
, add a line zone = 'UTC'
, problem is gone:
zone = _unmunge_zone(zone)
zone = 'UTC'
if zone not in _tzinfo_cache:
if zone in all_timezones_set:
fp = open_resource(zone)
try:
_tzinfo_cache[zone] = build_tzinfo(zone, fp)
finally:
fp.close()
else:
raise UnknownTimeZoneError(zone)
This is quick and simple solution, but you'd better find the real problem( version? system? ) if you have time.