Skip to content

Commit

Permalink
Merge pull request #643 from pganssle/update_2018
Browse files Browse the repository at this point in the history
Update tzdata to 2018d
  • Loading branch information
pganssle committed Mar 24, 2018
2 parents 3e06e86 + 4ef5212 commit 3b51c98
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
28 changes: 26 additions & 2 deletions dateutil/test/test_tz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2536,6 +2536,31 @@ def test_resolve_imaginary_existing(dt):
assert tz.resolve_imaginary(dt) is dt


def __get_kiritimati_resolve_imaginary_test():
# In the 2018d release of the IANA database, the Kiritimati "imaginary day"
# data was corrected, so if the system zoneinfo is older than 2018d, the
# Kiritimati test will fail.

tzi = tz.gettz('Pacific/Kiritimati')
new_version = False
if not tz.datetime_exists(datetime(1995, 1, 1, 12, 30), tzi):
zif = zoneinfo.get_zonefile_instance()
if zif.metadata is not None:
new_version = zif.metadata['tzversion'] >= '2018d'

if new_version:
tzi = zif.get('Pacific/Kiritimati')
else:
new_version = True

if new_version:
dates = (datetime(1994, 12, 31, 12, 30), datetime(1995, 1, 1, 12, 30))
else:
dates = (datetime(1995, 1, 1, 12, 30), datetime(1995, 1, 2, 12, 30))

return (tzi, ) + dates


@pytest.mark.tz_resolve_imaginary
@pytest.mark.parametrize('tzi, dt, dt_exp', [
(tz.gettz('Europe/London'),
Expand All @@ -2544,8 +2569,7 @@ def test_resolve_imaginary_existing(dt):
datetime(2017, 3, 12, 2, 30), datetime(2017, 3, 12, 3, 30)),
(tz.gettz('Australia/Sydney'),
datetime(2014, 10, 5, 2, 0), datetime(2014, 10, 5, 3, 0)),
(tz.gettz('Pacific/Kiritimati'),
datetime(1995, 1, 1, 12, 30), datetime(1995, 1, 2, 12, 30)),
__get_kiritimati_resolve_imaginary_test(),
])
def test_resolve_imaginary(tzi, dt, dt_exp):
dt = dt.replace(tzinfo=tzi)
Expand Down
Binary file modified dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions zonefile_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"https://dateutil.github.io/tzdata/tzdata/",
"ftp://ftp.iana.org/tz/releases/"
],
"tzdata_file": "tzdata2018c.tar.gz",
"tzdata_file_sha512": "0575c87c9ffcde7b7f62b0df928d8a0e8d93f832b5ef7227b3d8431686f851f1fd5372c7e768f2979830352433b31df7f3979a00c28ea3973a3a0987ebbfb835",
"tzversion": "2018c",
"tzdata_file": "tzdata2018d.tar.gz",
"tzdata_file_sha512": "ee961aedc34e134172523a29fb8a9358f42649d06ffcd2d8a6ad86eeb174a80af5bfc4637e9e52ecdc51fa3d01afef9fff660a69ed72904ff747a59b5634830b",
"tzversion": "2018d",
"zonegroups": [
"africa",
"antarctica",
Expand Down

0 comments on commit 3b51c98

Please sign in to comment.