Skip to content

Commit

Permalink
Updated pytz module to support latest timezone changes
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Jun 21, 2023
1 parent ab3c171 commit cd01684
Show file tree
Hide file tree
Showing 33 changed files with 217 additions and 127 deletions.
14 changes: 7 additions & 7 deletions libs/pytz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@


# The IANA (nee Olson) database is updated several times a year.
OLSON_VERSION = '2022f'
VERSION = '2022.6' # pip compatible version number.
OLSON_VERSION = '2023c'
VERSION = '2023.3' # pip compatible version number.
__version__ = VERSION

OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
Expand Down Expand Up @@ -202,7 +202,7 @@ def _case_insensitive_zone_lookup(zone):
"""case-insensitively matching timezone, else return zone unchanged"""
global _all_timezones_lower_to_standard
if _all_timezones_lower_to_standard is None:
_all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in all_timezones) # noqa
_all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in _all_timezones_unchecked) # noqa
return _all_timezones_lower_to_standard.get(zone.lower()) or zone # noqa


Expand Down Expand Up @@ -514,7 +514,7 @@ def _test():

if __name__ == '__main__':
_test()
all_timezones = \
_all_timezones_unchecked = \
['Africa/Abidjan',
'Africa/Accra',
'Africa/Addis_Ababa',
Expand Down Expand Up @@ -610,6 +610,7 @@ def _test():
'America/Cayman',
'America/Chicago',
'America/Chihuahua',
'America/Ciudad_Juarez',
'America/Coral_Harbour',
'America/Cordoba',
'America/Costa_Rica',
Expand Down Expand Up @@ -1111,7 +1112,7 @@ def _test():
'WET',
'Zulu']
all_timezones = LazyList(
tz for tz in all_timezones if resource_exists(tz))
tz for tz in _all_timezones_unchecked if resource_exists(tz))

all_timezones_set = LazySet(all_timezones)
common_timezones = \
Expand Down Expand Up @@ -1204,6 +1205,7 @@ def _test():
'America/Cayman',
'America/Chicago',
'America/Chihuahua',
'America/Ciudad_Juarez',
'America/Costa_Rica',
'America/Creston',
'America/Cuiaba',
Expand Down Expand Up @@ -1275,7 +1277,6 @@ def _test():
'America/Nuuk',
'America/Ojinaga',
'America/Panama',
'America/Pangnirtung',
'America/Paramaribo',
'America/Phoenix',
'America/Port-au-Prince',
Expand Down Expand Up @@ -1310,7 +1311,6 @@ def _test():
'America/Whitehorse',
'America/Winnipeg',
'America/Yakutat',
'America/Yellowknife',
'Antarctica/Casey',
'Antarctica/Davis',
'Antarctica/DumontDUrville',
Expand Down
4 changes: 2 additions & 2 deletions libs/pytz/tests/test_tzinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# I test for expected version to ensure the correct version of pytz is
# actually being tested.
EXPECTED_VERSION = '2022.6'
EXPECTED_OLSON_VERSION = '2022f'
EXPECTED_VERSION = '2023.3'
EXPECTED_OLSON_VERSION = '2023c'

fmt = '%Y-%m-%d %H:%M:%S %Z%z'

Expand Down
Binary file modified libs/pytz/zoneinfo/Africa/Cairo
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Africa/Casablanca
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Africa/El_Aaiun
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Bogota
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Cambridge_Bay
Binary file not shown.
Binary file added libs/pytz/zoneinfo/America/Ciudad_Juarez
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Godthab
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Inuvik
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Iqaluit
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Nuuk
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Ojinaga
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Pangnirtung
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Rankin_Inlet
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Resolute
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Whitehorse
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/America/Yellowknife
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Asia/Gaza
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Asia/Hebron
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Asia/Kuala_Lumpur
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Asia/Singapore
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Canada/Yukon
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Egypt
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Europe/Kirov
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Europe/Volgograd
Binary file not shown.
Binary file modified libs/pytz/zoneinfo/Singapore
Binary file not shown.
6 changes: 3 additions & 3 deletions libs/pytz/zoneinfo/iso3166.tab
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
# From Paul Eggert (2015-05-02):
# From Paul Eggert (2022-11-18):
# This file contains a table of two-letter country codes. Columns are
# separated by a single tab. Lines beginning with '#' are comments.
# All text uses UTF-8 encoding. The columns of the table are as follows:
#
# 1. ISO 3166-1 alpha-2 country code, current as of
# ISO 3166-1 N976 (2018-11-06). See: Updates on ISO 3166-1
# ISO 3166-1 N1087 (2022-09-02). See: Updates on ISO 3166-1
# https://isotc.iso.org/livelink/livelink/Open/16944257
# 2. The usual English name for the coded region,
# chosen so that alphabetic sorting of subsets produces helpful lists.
Expand Down Expand Up @@ -238,7 +238,7 @@ SY Syria
SZ Eswatini (Swaziland)
TC Turks & Caicos Is
TD Chad
TF French Southern & Antarctic Lands
TF French S. Terr.
TG Togo
TH Thailand
TJ Tajikistan
Expand Down
8 changes: 4 additions & 4 deletions libs/pytz/zoneinfo/leapseconds
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Leap 2016 Dec 31 23:59:60 + S
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
#Expires 2023 Jun 28 00:00:00
#Expires 2023 Dec 28 00:00:00

# POSIX timestamps for the data in this file:
#updated 1467936000 (2016-07-08 00:00:00 UTC)
#expires 1687910400 (2023-06-28 00:00:00 UTC)
#expires 1703721600 (2023-12-28 00:00:00 UTC)

# Updated through IERS Bulletin C64
# File expires on: 28 June 2023
# Updated through IERS Bulletin C65
# File expires on: 28 December 2023

0 comments on commit cd01684

Please sign in to comment.