Buenos Aires incorrect timezone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
astral |
Fix Released
|
Medium
|
Simon Kennedy |
Bug Description
I try this code
--- cut --
from astral import Astral
a = Astral()
c = a['Buenos Aires']
print c # get empty timezone
'''
Buenos Aires/Argentina, tz=, lat=-36.50, lon=-60.00
'''
s = c.sun()
print s # get error
'''
Traceback (most recent call last):
File "example-
s = c.sun()
File "astral.py", line 730, in sun
sun[key] = dt.astimezone(
File "astral.py", line 670, in fget
raise AstralError(
astral.AstralError: Unknown timezone ''
'''
--- cut --
Solution:
There is incorrect timezone for Buenos Aires in _LOCATION_INFO - "Argentina/
It should be "America/
I found correct timezone using pytz
--- cut ---
import pytz
pytz.all_timezones
--- cut ---
Changed in astral: | |
status: | Fix Committed → Fix Released |
pytz includes 2 names for Buenos Aires' time zone America/ Buenos_ Aires or America/ Argentina/ Buenos_ Aires. America/ Buenos_ Aires used as code currently assumes that a timezone only has 1 '/' in it.