diff -Nru python-tz-2019.3/debian/changelog python-tz-2020.1/debian/changelog --- python-tz-2019.3/debian/changelog 2020-04-14 02:37:17.000000000 +0000 +++ python-tz-2020.1/debian/changelog 2020-05-19 09:43:57.000000000 +0000 @@ -1,3 +1,11 @@ +python-tz (2020.1-1) unstable; urgency=medium + + * New upstream release + * Standards-Version: 4.5.0 + * Update d/copyright (year) + + -- Alastair McKinstry Tue, 19 May 2020 10:43:57 +0100 + python-tz (2019.3-2) unstable; urgency=medium * debian/control diff -Nru python-tz-2019.3/debian/control python-tz-2020.1/debian/control --- python-tz-2019.3/debian/control 2020-04-14 02:37:17.000000000 +0000 +++ python-tz-2020.1/debian/control 2020-05-19 09:43:57.000000000 +0000 @@ -12,7 +12,7 @@ python3-setuptools, python3-pytest, tzdata (>= 2017a), -Standards-Version: 4.4.1.0 +Standards-Version: 4.5.0 Homepage: http://pypi.python.org/pypi/pytz/ Vcs-Browser: https://salsa.debian.org/python-team/modules/python-tz Vcs-Git: https://salsa.debian.org/python-team/modules/python-tz.git diff -Nru python-tz-2019.3/debian/docs python-tz-2020.1/debian/docs --- python-tz-2019.3/debian/docs 2020-04-14 02:37:17.000000000 +0000 +++ python-tz-2020.1/debian/docs 2020-05-19 09:43:57.000000000 +0000 @@ -1 +1 @@ -README.txt +README.rst diff -Nru python-tz-2019.3/debian/rules python-tz-2020.1/debian/rules --- python-tz-2019.3/debian/rules 2020-04-14 02:37:17.000000000 +0000 +++ python-tz-2020.1/debian/rules 2020-05-19 09:43:57.000000000 +0000 @@ -1,7 +1,6 @@ #!/usr/bin/make -f export PYBUILD_NAME=tz -export PYBUILD_DISABLE_python2=test %: dh $@ --with=python2,python3 --buildsystem=pybuild @@ -14,6 +13,6 @@ override_dh_auto_test: dh_auto_test -- --before-test="\ - cp $(CURDIR)/README.txt {build_dir}; \ + cp $(CURDIR)/README.rst {build_dir}; \ cp -r $(CURDIR)/pytz/tests {build_dir}/pytz/" \ - --after-test="rm -rf {build_dir}/README.txt {build_dir}/pytz/tests" + --after-test="rm -rf {build_dir}/README.rst {build_dir}/pytz/tests" diff -Nru python-tz-2019.3/LICENSE.txt python-tz-2020.1/LICENSE.txt --- python-tz-2019.3/LICENSE.txt 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/LICENSE.txt 2020-05-19 09:44:45.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2003-2018 Stuart Bishop +Copyright (c) 2003-2019 Stuart Bishop Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff -Nru python-tz-2019.3/PKG-INFO python-tz-2020.1/PKG-INFO --- python-tz-2019.3/PKG-INFO 2019-10-07 03:17:43.000000000 +0000 +++ python-tz-2020.1/PKG-INFO 2020-05-19 09:44:45.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pytz -Version: 2019.3 +Version: 2020.1 Summary: World timezone definitions, modern and historical Home-page: http://pythonhosted.org/pytz Author: Stuart Bishop @@ -56,6 +56,14 @@ python setup.py install + pytz for Enterprise + ~~~~~~~~~~~~~~~~~~~ + + Available as part of the Tidelift Subscription. + + The maintainers of pytz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. `_. + + Example & Usage ~~~~~~~~~~~~~~~ @@ -561,7 +569,13 @@ Bugs, Feature Requests & Patches ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Bugs can be reported using `Launchpad `__. + Bugs can be reported using `Launchpad Bugs `_. + + + Security Issues + ~~~~~~~~~~~~~~~ + + Reports about security issues can be made via `Tidelift `_. Issues & Limitations diff -Nru python-tz-2019.3/pytz/exceptions.py python-tz-2020.1/pytz/exceptions.py --- python-tz-2019.3/pytz/exceptions.py 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/exceptions.py 2020-05-19 09:44:45.000000000 +0000 @@ -8,7 +8,11 @@ ] -class UnknownTimeZoneError(KeyError): +class Error(Exception): + '''Base class for all exceptions raised by the pytz library''' + + +class UnknownTimeZoneError(KeyError, Error): '''Exception raised when pytz is passed an unknown timezone. >>> isinstance(UnknownTimeZoneError(), LookupError) @@ -20,11 +24,18 @@ >>> isinstance(UnknownTimeZoneError(), KeyError) True + + And also a subclass of pytz.exceptions.Error, as are other pytz + exceptions. + + >>> isinstance(UnknownTimeZoneError(), Error) + True + ''' pass -class InvalidTimeError(Exception): +class InvalidTimeError(Error): '''Base class for invalid time exceptions.''' diff -Nru python-tz-2019.3/pytz/__init__.py python-tz-2020.1/pytz/__init__.py --- python-tz-2019.3/pytz/__init__.py 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/__init__.py 2020-05-19 09:44:45.000000000 +0000 @@ -22,8 +22,8 @@ # The IANA (nee Olson) database is updated several times a year. -OLSON_VERSION = '2019c' -VERSION = '2019.3' # pip compatible version number. +OLSON_VERSION = '2020a' +VERSION = '2020.1' # pip compatible version number. __version__ = VERSION OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling @@ -34,7 +34,7 @@ 'NonExistentTimeError', 'UnknownTimeZoneError', 'all_timezones', 'all_timezones_set', 'common_timezones', 'common_timezones_set', - 'BaseTzInfo', + 'BaseTzInfo', 'FixedOffset', ] @@ -263,8 +263,8 @@ module global. These examples belong in the UTC class above, but it is obscured; or in - the README.txt, but we are not depending on Python 2.4 so integrating - the README.txt examples with the unit tests is not trivial. + the README.rst, but we are not depending on Python 2.4 so integrating + the README.rst examples with the unit tests is not trivial. >>> import datetime, pickle >>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc) @@ -683,6 +683,7 @@ 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', + 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', @@ -1210,7 +1211,6 @@ 'America/Fort_Nelson', 'America/Fortaleza', 'America/Glace_Bay', - 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', @@ -1264,6 +1264,7 @@ 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', + 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', diff -Nru python-tz-2019.3/pytz/tests/test_docs.py python-tz-2020.1/pytz/tests/test_docs.py --- python-tz-2019.3/pytz/tests/test_docs.py 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/tests/test_docs.py 2020-05-19 09:44:45.000000000 +0000 @@ -7,12 +7,12 @@ THIS_DIR = os.path.dirname(__file__) -README = os.path.join(THIS_DIR, os.pardir, os.pardir, 'README.txt') +README = os.path.join(THIS_DIR, os.pardir, os.pardir, 'README.rst') class DocumentationTestCase(unittest.TestCase): def test_readme_encoding(self): - '''Confirm the README.txt is pure ASCII.''' + '''Confirm the README.rst is ASCII.''' f = open(README, 'rb') try: f.read().decode('ASCII') @@ -24,7 +24,7 @@ "For the Z3 test runner" return unittest.TestSuite(( DocumentationTestCase('test_readme_encoding'), - DocFileSuite(os.path.join(os.pardir, os.pardir, 'README.txt')))) + DocFileSuite(os.path.join(os.pardir, os.pardir, 'README.rst')))) if __name__ == '__main__': diff -Nru python-tz-2019.3/pytz/tests/test_tzinfo.py python-tz-2020.1/pytz/tests/test_tzinfo.py --- python-tz-2019.3/pytz/tests/test_tzinfo.py 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/tests/test_tzinfo.py 2020-05-19 09:44:45.000000000 +0000 @@ -27,8 +27,8 @@ # I test for expected version to ensure the correct version of pytz is # actually being tested. -EXPECTED_VERSION = '2019.3' -EXPECTED_OLSON_VERSION = '2019c' +EXPECTED_VERSION = '2020.1' +EXPECTED_OLSON_VERSION = '2020a' fmt = '%Y-%m-%d %H:%M:%S %Z%z' @@ -859,6 +859,7 @@ suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite('pytz')) suite.addTest(doctest.DocTestSuite('pytz.tzinfo')) + suite.addTest(doctest.DocTestSuite('pytz.exceptions')) import test_tzinfo suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_tzinfo)) return suite Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Africa/Casablanca and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Africa/Casablanca differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Africa/El_Aaiun and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Africa/El_Aaiun differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/America/Dawson and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/America/Dawson differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/America/Nuuk and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/America/Nuuk differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/America/Whitehorse and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/America/Whitehorse differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Asia/Chongqing and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Asia/Chongqing differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Asia/Chungking and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Asia/Chungking differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Asia/Harbin and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Asia/Harbin differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Asia/Shanghai and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Asia/Shanghai differ Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/Canada/Yukon and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/Canada/Yukon differ diff -Nru python-tz-2019.3/pytz/zoneinfo/leapseconds python-tz-2020.1/pytz/zoneinfo/leapseconds --- python-tz-2019.3/pytz/zoneinfo/leapseconds 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/zoneinfo/leapseconds 2020-05-19 09:44:45.000000000 +0000 @@ -64,9 +64,15 @@ Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S +# UTC timestamp when this leap second list expires. +# 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 2020 Dec 28 00:00:00 + # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1593302400 (2020-06-28 00:00:00 UTC) +#expires 1609113600 (2020-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 Binary files /tmp/tmp6mxmQC/0PvhMz3S3Z/python-tz-2019.3/pytz/zoneinfo/PRC and /tmp/tmp6mxmQC/7O94f8mFNH/python-tz-2020.1/pytz/zoneinfo/PRC differ diff -Nru python-tz-2019.3/pytz/zoneinfo/tzdata.zi python-tz-2020.1/pytz/zoneinfo/tzdata.zi --- python-tz-2019.3/pytz/zoneinfo/tzdata.zi 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/zoneinfo/tzdata.zi 2020-05-19 09:44:45.000000000 +0000 @@ -187,7 +187,7 @@ R M 2019 o - May 5 3 -1 - R M 2019 o - Jun 9 2 0 - R M 2020 o - Ap 19 3 -1 - -R M 2020 o - May 24 2 0 - +R M 2020 o - May 31 2 0 - R M 2021 o - Ap 11 3 -1 - R M 2021 o - May 16 2 0 - R M 2022 o - Mar 27 3 -1 - @@ -203,7 +203,7 @@ R M 2027 o - F 7 3 -1 - R M 2027 o - Mar 14 2 0 - R M 2028 o - Ja 23 3 -1 - -R M 2028 o - F 27 2 0 - +R M 2028 o - Mar 5 2 0 - R M 2029 o - Ja 14 3 -1 - R M 2029 o - F 18 2 0 - R M 2029 o - D 30 3 -1 - @@ -219,7 +219,7 @@ R M 2034 o - N 5 3 -1 - R M 2034 o - D 17 2 0 - R M 2035 o - O 28 3 -1 - -R M 2035 o - D 2 2 0 - +R M 2035 o - D 9 2 0 - R M 2036 o - O 19 3 -1 - R M 2036 o - N 23 2 0 - R M 2037 o - O 4 3 -1 - @@ -235,7 +235,7 @@ R M 2042 o - Au 10 3 -1 - R M 2042 o - S 21 2 0 - R M 2043 o - Au 2 3 -1 - -R M 2043 o - S 6 2 0 - +R M 2043 o - S 13 2 0 - R M 2044 o - Jul 24 3 -1 - R M 2044 o - Au 28 2 0 - R M 2045 o - Jul 9 3 -1 - @@ -251,7 +251,7 @@ R M 2050 o - May 15 3 -1 - R M 2050 o - Jun 26 2 0 - R M 2051 o - May 7 3 -1 - -R M 2051 o - Jun 11 2 0 - +R M 2051 o - Jun 18 2 0 - R M 2052 o - Ap 28 3 -1 - R M 2052 o - Jun 2 2 0 - R M 2053 o - Ap 13 3 -1 - @@ -267,7 +267,7 @@ R M 2058 o - F 17 3 -1 - R M 2058 o - Mar 31 2 0 - R M 2059 o - F 9 3 -1 - -R M 2059 o - Mar 16 2 0 - +R M 2059 o - Mar 23 2 0 - R M 2060 o - F 1 3 -1 - R M 2060 o - Mar 7 2 0 - R M 2061 o - Ja 16 3 -1 - @@ -277,13 +277,13 @@ R M 2062 o - D 31 3 -1 - R M 2063 o - F 4 2 0 - R M 2063 o - D 16 3 -1 - -R M 2064 o - Ja 20 2 0 - +R M 2064 o - Ja 27 2 0 - R M 2064 o - D 7 3 -1 - R M 2065 o - Ja 11 2 0 - R M 2065 o - N 22 3 -1 - R M 2066 o - Ja 3 2 0 - R M 2066 o - N 14 3 -1 - -R M 2066 o - D 19 2 0 - +R M 2066 o - D 26 2 0 - R M 2067 o - N 6 3 -1 - R M 2067 o - D 11 2 0 - R M 2068 o - O 21 3 -1 - @@ -293,13 +293,13 @@ R M 2070 o - O 5 3 -1 - R M 2070 o - N 9 2 0 - R M 2071 o - S 20 3 -1 - -R M 2071 o - O 25 2 0 - +R M 2071 o - N 1 2 0 - R M 2072 o - S 11 3 -1 - R M 2072 o - O 16 2 0 - R M 2073 o - Au 27 3 -1 - R M 2073 o - O 8 2 0 - R M 2074 o - Au 19 3 -1 - -R M 2074 o - S 23 2 0 - +R M 2074 o - S 30 2 0 - R M 2075 o - Au 11 3 -1 - R M 2075 o - S 15 2 0 - R M 2076 o - Jul 26 3 -1 - @@ -309,7 +309,7 @@ R M 2078 o - Jul 10 3 -1 - R M 2078 o - Au 14 2 0 - R M 2079 o - Jun 25 3 -1 - -R M 2079 o - Jul 30 2 0 - +R M 2079 o - Au 6 2 0 - R M 2080 o - Jun 16 3 -1 - R M 2080 o - Jul 21 2 0 - R M 2081 o - Jun 1 3 -1 - @@ -325,7 +325,7 @@ R M 2086 o - Ap 14 3 -1 - R M 2086 o - May 19 2 0 - R M 2087 o - Mar 30 3 -1 - -R M 2087 o - May 4 2 0 - +R M 2087 o - May 11 2 0 - Z Africa/Casablanca -0:30:20 - LMT 1913 O 26 0 M +00/+01 1984 Mar 16 1 - +01 1986 @@ -498,6 +498,8 @@ 6:30 - +0630 1942 May 9 - +09 1945 May 3 6:30 - +0630 +R Sh 1919 o - Ap 12 24 1 D +R Sh 1919 o - S 30 24 0 S R Sh 1940 o - Jun 1 0 1 D R Sh 1940 o - O 12 24 0 S R Sh 1941 o - Mar 15 0 1 D @@ -1921,7 +1923,7 @@ -2 - -02 1980 Ap 6 2 -2 c -02/-01 1981 Mar 29 -1 E -01/+00 -Z America/Godthab -3:26:56 - LMT 1916 Jul 28 +Z America/Nuuk -3:26:56 - LMT 1916 Jul 28 -3 - -03 1980 Ap 6 2 -3 E -03/-02 Z America/Thule -4:35:8 - LMT 1916 Jul 28 @@ -3411,11 +3413,13 @@ Z America/Whitehorse -9:0:12 - LMT 1900 Au 20 -9 Y Y%sT 1967 May 28 -8 Y P%sT 1980 --8 C P%sT +-8 C P%sT 2020 Mar 8 2 +-7 - MST Z America/Dawson -9:17:40 - LMT 1900 Au 20 -9 Y Y%sT 1973 O 28 -8 Y P%sT 1980 --8 C P%sT +-8 C P%sT 2020 Mar 8 2 +-7 - MST R m 1939 o - F 5 0 1 D R m 1939 o - Jun 25 0 0 S R m 1940 o - D 9 0 1 D @@ -4294,6 +4298,7 @@ L America/Argentina/Cordoba America/Cordoba L America/Tijuana America/Ensenada L America/Indiana/Indianapolis America/Fort_Wayne +L America/Nuuk America/Godthab L America/Indiana/Indianapolis America/Indianapolis L America/Argentina/Jujuy America/Jujuy L America/Indiana/Knox America/Knox_IN diff -Nru python-tz-2019.3/pytz/zoneinfo/zone1970.tab python-tz-2020.1/pytz/zoneinfo/zone1970.tab --- python-tz-2019.3/pytz/zoneinfo/zone1970.tab 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/zoneinfo/zone1970.tab 2020-05-19 09:44:45.000000000 +0000 @@ -128,8 +128,8 @@ CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John) CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson) CA +4916-12307 America/Vancouver Pacific - BC (most areas) -CA +6043-13503 America/Whitehorse Pacific - Yukon (south) -CA +6404-13925 America/Dawson Pacific - Yukon (north) +CA +6043-13503 America/Whitehorse Pacific - Yukon (east) +CA +6404-13925 America/Dawson Pacific - Yukon (west) CC -1210+09655 Indian/Cocos CH,DE,LI +4723+00832 Europe/Zurich Swiss time CI,BF,GM,GN,ML,MR,SH,SL,SN,TG +0519-00402 Africa/Abidjan @@ -173,7 +173,7 @@ GF +0456-05220 America/Cayenne GH +0533-00013 Africa/Accra GI +3608-00521 Europe/Gibraltar -GL +6411-05144 America/Godthab Greenland (most areas) +GL +6411-05144 America/Nuuk Greenland (most areas) GL +7646-01840 America/Danmarkshavn National Park (east coast) GL +7029-02158 America/Scoresbysund Scoresbysund/Ittoqqortoormiit GL +7634-06847 America/Thule Thule/Pituffik @@ -290,7 +290,7 @@ RU +5443+02030 Europe/Kaliningrad MSK-01 - Kaliningrad RU +554521+0373704 Europe/Moscow MSK+00 - Moscow area # Mention RU and UA alphabetically. See "territorial claims" above. -RU,UA +4457+03406 Europe/Simferopol MSK+00 - Crimea +RU,UA +4457+03406 Europe/Simferopol Crimea RU +5836+04939 Europe/Kirov MSK+00 - Kirov RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan RU +4844+04425 Europe/Volgograd MSK+01 - Volgograd @@ -341,8 +341,8 @@ TV -0831+17913 Pacific/Funafuti TW +2503+12130 Asia/Taipei UA +5026+03031 Europe/Kiev Ukraine (most areas) -UA +4837+02218 Europe/Uzhgorod Ruthenia -UA +4750+03510 Europe/Zaporozhye Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east) +UA +4837+02218 Europe/Uzhgorod Transcarpathia +UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk UM +1917+16637 Pacific/Wake Wake Island US +404251-0740023 America/New_York Eastern (most areas) US +421953-0830245 America/Detroit Eastern - MI (most areas) diff -Nru python-tz-2019.3/pytz/zoneinfo/zone.tab python-tz-2020.1/pytz/zoneinfo/zone.tab --- python-tz-2019.3/pytz/zoneinfo/zone.tab 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/pytz/zoneinfo/zone.tab 2020-05-19 09:44:45.000000000 +0000 @@ -131,8 +131,8 @@ CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John) CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson) CA +4916-12307 America/Vancouver Pacific - BC (most areas) -CA +6043-13503 America/Whitehorse Pacific - Yukon (south) -CA +6404-13925 America/Dawson Pacific - Yukon (north) +CA +6043-13503 America/Whitehorse Pacific - Yukon (east) +CA +6404-13925 America/Dawson Pacific - Yukon (west) CC -1210+09655 Indian/Cocos CD -0418+01518 Africa/Kinshasa Dem. Rep. of Congo (west) CD -1140+02728 Africa/Lubumbashi Dem. Rep. of Congo (east) @@ -189,7 +189,7 @@ GG +492717-0023210 Europe/Guernsey GH +0533-00013 Africa/Accra GI +3608-00521 Europe/Gibraltar -GL +6411-05144 America/Godthab Greenland (most areas) +GL +6411-05144 America/Nuuk Greenland (most areas) GL +7646-01840 America/Danmarkshavn National Park (east coast) GL +7029-02158 America/Scoresbysund Scoresbysund/Ittoqqortoormiit GL +7634-06847 America/Thule Thule/Pituffik @@ -335,7 +335,7 @@ # The obsolescent zone.tab format cannot represent Europe/Simferopol well. # Put it in RU section and list as UA. See "territorial claims" above. # Programs should use zone1970.tab instead; see above. -UA +4457+03406 Europe/Simferopol MSK+00 - Crimea +UA +4457+03406 Europe/Simferopol Crimea RU +5836+04939 Europe/Kirov MSK+00 - Kirov RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan RU +4844+04425 Europe/Volgograd MSK+01 - Volgograd @@ -399,8 +399,8 @@ TW +2503+12130 Asia/Taipei TZ -0648+03917 Africa/Dar_es_Salaam UA +5026+03031 Europe/Kiev Ukraine (most areas) -UA +4837+02218 Europe/Uzhgorod Ruthenia -UA +4750+03510 Europe/Zaporozhye Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east) +UA +4837+02218 Europe/Uzhgorod Transcarpathia +UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk UG +0019+03225 Africa/Kampala UM +2813-17722 Pacific/Midway Midway Islands UM +1917+16637 Pacific/Wake Wake Island diff -Nru python-tz-2019.3/pytz.egg-info/PKG-INFO python-tz-2020.1/pytz.egg-info/PKG-INFO --- python-tz-2019.3/pytz.egg-info/PKG-INFO 2019-10-07 03:17:43.000000000 +0000 +++ python-tz-2020.1/pytz.egg-info/PKG-INFO 2020-05-19 09:44:45.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pytz -Version: 2019.3 +Version: 2020.1 Summary: World timezone definitions, modern and historical Home-page: http://pythonhosted.org/pytz Author: Stuart Bishop @@ -56,6 +56,14 @@ python setup.py install + pytz for Enterprise + ~~~~~~~~~~~~~~~~~~~ + + Available as part of the Tidelift Subscription. + + The maintainers of pytz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. `_. + + Example & Usage ~~~~~~~~~~~~~~~ @@ -561,7 +569,13 @@ Bugs, Feature Requests & Patches ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Bugs can be reported using `Launchpad `__. + Bugs can be reported using `Launchpad Bugs `_. + + + Security Issues + ~~~~~~~~~~~~~~~ + + Reports about security issues can be made via `Tidelift `_. Issues & Limitations diff -Nru python-tz-2019.3/pytz.egg-info/SOURCES.txt python-tz-2020.1/pytz.egg-info/SOURCES.txt --- python-tz-2019.3/pytz.egg-info/SOURCES.txt 2019-10-07 03:17:43.000000000 +0000 +++ python-tz-2020.1/pytz.egg-info/SOURCES.txt 2020-05-19 09:44:45.000000000 +0000 @@ -1,6 +1,6 @@ LICENSE.txt MANIFEST.in -README.txt +README.rst setup.cfg setup.py pytz/__init__.py @@ -217,6 +217,7 @@ pytz/zoneinfo/America/Nipigon pytz/zoneinfo/America/Nome pytz/zoneinfo/America/Noronha +pytz/zoneinfo/America/Nuuk pytz/zoneinfo/America/Ojinaga pytz/zoneinfo/America/Panama pytz/zoneinfo/America/Pangnirtung diff -Nru python-tz-2019.3/README.rst python-tz-2020.1/README.rst --- python-tz-2019.3/README.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-tz-2020.1/README.rst 2020-05-19 09:44:45.000000000 +0000 @@ -0,0 +1,596 @@ +pytz - World Timezone Definitions for Python +============================================ + +:Author: Stuart Bishop + +Introduction +~~~~~~~~~~~~ + +pytz brings the Olson tz database into Python. This library allows +accurate and cross platform timezone calculations using Python 2.4 +or higher. It also solves the issue of ambiguous times at the end +of daylight saving time, which you can read more about in the Python +Library Reference (``datetime.tzinfo``). + +Almost all of the Olson timezones are supported. + +.. note:: + + This library differs from the documented Python API for + tzinfo implementations; if you want to create local wallclock + times you need to use the ``localize()`` method documented in this + document. In addition, if you perform date arithmetic on local + times that cross DST boundaries, the result may be in an incorrect + timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get + 2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A + ``normalize()`` method is provided to correct this. Unfortunately these + issues cannot be resolved without modifying the Python datetime + implementation (see PEP-431). + + +Installation +~~~~~~~~~~~~ + +This package can either be installed using ``pip`` or from a tarball using the +standard Python distutils. + +If you are installing using ``pip``, you don't need to download anything as the +latest version will be downloaded for you from PyPI:: + + pip install pytz + +If you are installing from a tarball, run the following command as an +administrative user:: + + python setup.py install + + +pytz for Enterprise +~~~~~~~~~~~~~~~~~~~ + +Available as part of the Tidelift Subscription. + +The maintainers of pytz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. `_. + + +Example & Usage +~~~~~~~~~~~~~~~ + +Localized times and date arithmetic +----------------------------------- + +>>> from datetime import datetime, timedelta +>>> from pytz import timezone +>>> import pytz +>>> utc = pytz.utc +>>> utc.zone +'UTC' +>>> eastern = timezone('US/Eastern') +>>> eastern.zone +'US/Eastern' +>>> amsterdam = timezone('Europe/Amsterdam') +>>> fmt = '%Y-%m-%d %H:%M:%S %Z%z' + +This library only supports two ways of building a localized time. The +first is to use the ``localize()`` method provided by the pytz library. +This is used to localize a naive datetime (datetime with no timezone +information): + +>>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0)) +>>> print(loc_dt.strftime(fmt)) +2002-10-27 06:00:00 EST-0500 + +The second way of building a localized time is by converting an existing +localized time using the standard ``astimezone()`` method: + +>>> ams_dt = loc_dt.astimezone(amsterdam) +>>> ams_dt.strftime(fmt) +'2002-10-27 12:00:00 CET+0100' + +Unfortunately using the tzinfo argument of the standard datetime +constructors ''does not work'' with pytz for many timezones. + +>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt) # /!\ Does not work this way! +'2002-10-27 12:00:00 LMT+0020' + +It is safe for timezones without daylight saving transitions though, such +as UTC: + +>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt) # /!\ Not recommended except for UTC +'2002-10-27 12:00:00 UTC+0000' + +The preferred way of dealing with times is to always work in UTC, +converting to localtime only when generating output to be read +by humans. + +>>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc) +>>> loc_dt = utc_dt.astimezone(eastern) +>>> loc_dt.strftime(fmt) +'2002-10-27 01:00:00 EST-0500' + +This library also allows you to do date arithmetic using local +times, although it is more complicated than working in UTC as you +need to use the ``normalize()`` method to handle daylight saving time +and other timezone transitions. In this example, ``loc_dt`` is set +to the instant when daylight saving time ends in the US/Eastern +timezone. + +>>> before = loc_dt - timedelta(minutes=10) +>>> before.strftime(fmt) +'2002-10-27 00:50:00 EST-0500' +>>> eastern.normalize(before).strftime(fmt) +'2002-10-27 01:50:00 EDT-0400' +>>> after = eastern.normalize(before + timedelta(minutes=20)) +>>> after.strftime(fmt) +'2002-10-27 01:10:00 EST-0500' + +Creating local times is also tricky, and the reason why working with +local times is not recommended. Unfortunately, you cannot just pass +a ``tzinfo`` argument when constructing a datetime (see the next +section for more details) + +>>> dt = datetime(2002, 10, 27, 1, 30, 0) +>>> dt1 = eastern.localize(dt, is_dst=True) +>>> dt1.strftime(fmt) +'2002-10-27 01:30:00 EDT-0400' +>>> dt2 = eastern.localize(dt, is_dst=False) +>>> dt2.strftime(fmt) +'2002-10-27 01:30:00 EST-0500' + +Converting between timezones is more easily done, using the +standard astimezone method. + +>>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899)) +>>> utc_dt.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' +>>> au_tz = timezone('Australia/Sydney') +>>> au_dt = utc_dt.astimezone(au_tz) +>>> au_dt.strftime(fmt) +'2006-03-27 08:34:59 AEDT+1100' +>>> utc_dt2 = au_dt.astimezone(utc) +>>> utc_dt2.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' +>>> utc_dt == utc_dt2 +True + +You can take shortcuts when dealing with the UTC side of timezone +conversions. ``normalize()`` and ``localize()`` are not really +necessary when there are no daylight saving time transitions to +deal with. + +>>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc) +>>> utc_dt.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' +>>> au_tz = timezone('Australia/Sydney') +>>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz)) +>>> au_dt.strftime(fmt) +'2006-03-27 08:34:59 AEDT+1100' +>>> utc_dt2 = au_dt.astimezone(utc) +>>> utc_dt2.strftime(fmt) +'2006-03-26 21:34:59 UTC+0000' + + +``tzinfo`` API +-------------- + +The ``tzinfo`` instances returned by the ``timezone()`` function have +been extended to cope with ambiguous times by adding an ``is_dst`` +parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods. + +>>> tz = timezone('America/St_Johns') + +>>> normal = datetime(2009, 9, 1) +>>> ambiguous = datetime(2009, 10, 31, 23, 30) + +The ``is_dst`` parameter is ignored for most timestamps. It is only used +during DST transition ambiguous periods to resolve that ambiguity. + +>>> print(tz.utcoffset(normal, is_dst=True)) +-1 day, 21:30:00 +>>> print(tz.dst(normal, is_dst=True)) +1:00:00 +>>> tz.tzname(normal, is_dst=True) +'NDT' + +>>> print(tz.utcoffset(ambiguous, is_dst=True)) +-1 day, 21:30:00 +>>> print(tz.dst(ambiguous, is_dst=True)) +1:00:00 +>>> tz.tzname(ambiguous, is_dst=True) +'NDT' + +>>> print(tz.utcoffset(normal, is_dst=False)) +-1 day, 21:30:00 +>>> tz.dst(normal, is_dst=False) +datetime.timedelta(0, 3600) +>>> tz.tzname(normal, is_dst=False) +'NDT' + +>>> print(tz.utcoffset(ambiguous, is_dst=False)) +-1 day, 20:30:00 +>>> tz.dst(ambiguous, is_dst=False) +datetime.timedelta(0) +>>> tz.tzname(ambiguous, is_dst=False) +'NST' + +If ``is_dst`` is not specified, ambiguous timestamps will raise +an ``pytz.exceptions.AmbiguousTimeError`` exception. + +>>> print(tz.utcoffset(normal)) +-1 day, 21:30:00 +>>> print(tz.dst(normal)) +1:00:00 +>>> tz.tzname(normal) +'NDT' + +>>> import pytz.exceptions +>>> try: +... tz.utcoffset(ambiguous) +... except pytz.exceptions.AmbiguousTimeError: +... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) +pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 +>>> try: +... tz.dst(ambiguous) +... except pytz.exceptions.AmbiguousTimeError: +... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) +pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 +>>> try: +... tz.tzname(ambiguous) +... except pytz.exceptions.AmbiguousTimeError: +... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) +pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 + + +Problems with Localtime +~~~~~~~~~~~~~~~~~~~~~~~ + +The major problem we have to deal with is that certain datetimes +may occur twice in a year. For example, in the US/Eastern timezone +on the last Sunday morning in October, the following sequence +happens: + + - 01:00 EDT occurs + - 1 hour later, instead of 2:00am the clock is turned back 1 hour + and 01:00 happens again (this time 01:00 EST) + +In fact, every instant between 01:00 and 02:00 occurs twice. This means +that if you try and create a time in the 'US/Eastern' timezone +the standard datetime syntax, there is no way to specify if you meant +before of after the end-of-daylight-saving-time transition. Using the +pytz custom syntax, the best you can do is make an educated guess: + +>>> loc_dt = eastern.localize(datetime(2002, 10, 27, 1, 30, 00)) +>>> loc_dt.strftime(fmt) +'2002-10-27 01:30:00 EST-0500' + +As you can see, the system has chosen one for you and there is a 50% +chance of it being out by one hour. For some applications, this does +not matter. However, if you are trying to schedule meetings with people +in different timezones or analyze log files it is not acceptable. + +The best and simplest solution is to stick with using UTC. The pytz +package encourages using UTC for internal timezone representation by +including a special UTC implementation based on the standard Python +reference implementation in the Python documentation. + +The UTC timezone unpickles to be the same instance, and pickles to a +smaller size than other pytz tzinfo instances. The UTC implementation +can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC'). + +>>> import pickle, pytz +>>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc) +>>> naive = dt.replace(tzinfo=None) +>>> p = pickle.dumps(dt, 1) +>>> naive_p = pickle.dumps(naive, 1) +>>> len(p) - len(naive_p) +17 +>>> new = pickle.loads(p) +>>> new == dt +True +>>> new is dt +False +>>> new.tzinfo is dt.tzinfo +True +>>> pytz.utc is pytz.UTC is pytz.timezone('UTC') +True + +Note that some other timezones are commonly thought of as the same (GMT, +Greenwich, Universal, etc.). The definition of UTC is distinct from these +other timezones, and they are not equivalent. For this reason, they will +not compare the same in Python. + +>>> utc == pytz.timezone('GMT') +False + +See the section `What is UTC`_, below. + +If you insist on working with local times, this library provides a +facility for constructing them unambiguously: + +>>> loc_dt = datetime(2002, 10, 27, 1, 30, 00) +>>> est_dt = eastern.localize(loc_dt, is_dst=True) +>>> edt_dt = eastern.localize(loc_dt, is_dst=False) +>>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt)) +2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500 + +If you pass None as the is_dst flag to localize(), pytz will refuse to +guess and raise exceptions if you try to build ambiguous or non-existent +times. + +For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern +timezone when the clocks where put back at the end of Daylight Saving +Time: + +>>> dt = datetime(2002, 10, 27, 1, 30, 00) +>>> try: +... eastern.localize(dt, is_dst=None) +... except pytz.exceptions.AmbiguousTimeError: +... print('pytz.exceptions.AmbiguousTimeError: %s' % dt) +pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00 + +Similarly, 2:30am on 7th April 2002 never happened at all in the +US/Eastern timezone, as the clocks where put forward at 2:00am skipping +the entire hour: + +>>> dt = datetime(2002, 4, 7, 2, 30, 00) +>>> try: +... eastern.localize(dt, is_dst=None) +... except pytz.exceptions.NonExistentTimeError: +... print('pytz.exceptions.NonExistentTimeError: %s' % dt) +pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00 + +Both of these exceptions share a common base class to make error handling +easier: + +>>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError) +True +>>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError) +True + + +A special case is where countries change their timezone definitions +with no daylight savings time switch. For example, in 1915 Warsaw +switched from Warsaw time to Central European time with no daylight savings +transition. So at the stroke of midnight on August 5th 1915 the clocks +were wound back 24 minutes creating an ambiguous time period that cannot +be specified without referring to the timezone abbreviation or the +actual UTC offset. In this case midnight happened twice, neither time +during a daylight saving time period. pytz handles this transition by +treating the ambiguous period before the switch as daylight savings +time, and the ambiguous period after as standard time. + + +>>> warsaw = pytz.timezone('Europe/Warsaw') +>>> amb_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=True) +>>> amb_dt1.strftime(fmt) +'1915-08-04 23:59:59 WMT+0124' +>>> amb_dt2 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False) +>>> amb_dt2.strftime(fmt) +'1915-08-04 23:59:59 CET+0100' +>>> switch_dt = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False) +>>> switch_dt.strftime(fmt) +'1915-08-05 00:00:00 CET+0100' +>>> str(switch_dt - amb_dt1) +'0:24:01' +>>> str(switch_dt - amb_dt2) +'0:00:01' + +The best way of creating a time during an ambiguous time period is +by converting from another timezone such as UTC: + +>>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc) +>>> utc_dt.astimezone(warsaw).strftime(fmt) +'1915-08-04 23:36:00 CET+0100' + +The standard Python way of handling all these ambiguities is not to +handle them, such as demonstrated in this example using the US/Eastern +timezone definition from the Python documentation (Note that this +implementation only works for dates between 1987 and 2006 - it is +included for tests only!): + +>>> from pytz.reference import Eastern # pytz.reference only for tests +>>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern) +>>> str(dt) +'2002-10-27 00:30:00-04:00' +>>> str(dt + timedelta(hours=1)) +'2002-10-27 01:30:00-05:00' +>>> str(dt + timedelta(hours=2)) +'2002-10-27 02:30:00-05:00' +>>> str(dt + timedelta(hours=3)) +'2002-10-27 03:30:00-05:00' + +Notice the first two results? At first glance you might think they are +correct, but taking the UTC offset into account you find that they are +actually two hours appart instead of the 1 hour we asked for. + +>>> from pytz.reference import UTC # pytz.reference only for tests +>>> str(dt.astimezone(UTC)) +'2002-10-27 04:30:00+00:00' +>>> str((dt + timedelta(hours=1)).astimezone(UTC)) +'2002-10-27 06:30:00+00:00' + + +Country Information +~~~~~~~~~~~~~~~~~~~ + +A mechanism is provided to access the timezones commonly in use +for a particular country, looked up using the ISO 3166 country code. +It returns a list of strings that can be used to retrieve the relevant +tzinfo instance using ``pytz.timezone()``: + +>>> print(' '.join(pytz.country_timezones['nz'])) +Pacific/Auckland Pacific/Chatham + +The Olson database comes with a ISO 3166 country code to English country +name mapping that pytz exposes as a dictionary: + +>>> print(pytz.country_names['nz']) +New Zealand + + +What is UTC +~~~~~~~~~~~ + +'UTC' is `Coordinated Universal Time`_. It is a successor to, but distinct +from, Greenwich Mean Time (GMT) and the various definitions of Universal +Time. UTC is now the worldwide standard for regulating clocks and time +measurement. + +All other timezones are defined relative to UTC, and include offsets like +UTC+0800 - hours to add or subtract from UTC to derive the local time. No +daylight saving time occurs in UTC, making it a useful timezone to perform +date arithmetic without worrying about the confusion and ambiguities caused +by daylight saving time transitions, your country changing its timezone, or +mobile computers that roam through multiple timezones. + +.. _Coordinated Universal Time: https://en.wikipedia.org/wiki/Coordinated_Universal_Time + + +Helpers +~~~~~~~ + +There are two lists of timezones provided. + +``all_timezones`` is the exhaustive list of the timezone names that can +be used. + +>>> from pytz import all_timezones +>>> len(all_timezones) >= 500 +True +>>> 'Etc/Greenwich' in all_timezones +True + +``common_timezones`` is a list of useful, current timezones. It doesn't +contain deprecated zones or historical zones, except for a few I've +deemed in common usage, such as US/Eastern (open a bug report if you +think other timezones are deserving of being included here). It is also +a sequence of strings. + +>>> from pytz import common_timezones +>>> len(common_timezones) < len(all_timezones) +True +>>> 'Etc/Greenwich' in common_timezones +False +>>> 'Australia/Melbourne' in common_timezones +True +>>> 'US/Eastern' in common_timezones +True +>>> 'Canada/Eastern' in common_timezones +True +>>> 'Australia/Yancowinna' in all_timezones +True +>>> 'Australia/Yancowinna' in common_timezones +False + +Both ``common_timezones`` and ``all_timezones`` are alphabetically +sorted: + +>>> common_timezones_dupe = common_timezones[:] +>>> common_timezones_dupe.sort() +>>> common_timezones == common_timezones_dupe +True +>>> all_timezones_dupe = all_timezones[:] +>>> all_timezones_dupe.sort() +>>> all_timezones == all_timezones_dupe +True + +``all_timezones`` and ``common_timezones`` are also available as sets. + +>>> from pytz import all_timezones_set, common_timezones_set +>>> 'US/Eastern' in all_timezones_set +True +>>> 'US/Eastern' in common_timezones_set +True +>>> 'Australia/Victoria' in common_timezones_set +False + +You can also retrieve lists of timezones used by particular countries +using the ``country_timezones()`` function. It requires an ISO-3166 +two letter country code. + +>>> from pytz import country_timezones +>>> print(' '.join(country_timezones('ch'))) +Europe/Zurich +>>> print(' '.join(country_timezones('CH'))) +Europe/Zurich + + +Internationalization - i18n/l10n +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Pytz is an interface to the IANA database, which uses ASCII names. The `Unicode Consortium's Unicode Locales (CLDR) `_ +project provides translations. Thomas Khyn's +`l18n `_ package can be used to access +these translations from Python. + + +License +~~~~~~~ + +MIT license. + +This code is also available as part of Zope 3 under the Zope Public +License, Version 2.1 (ZPL). + +I'm happy to relicense this code if necessary for inclusion in other +open source projects. + + +Latest Versions +~~~~~~~~~~~~~~~ + +This package will be updated after releases of the Olson timezone +database. The latest version can be downloaded from the `Python Package +Index `_. The code that is used +to generate this distribution is hosted on launchpad.net and available +using git:: + + git clone https://git.launchpad.net/pytz + +A mirror on github is also available at https://github.com/stub42/pytz + +Announcements of new releases are made on +`Launchpad `_, and the +`Atom feed `_ +hosted there. + + +Bugs, Feature Requests & Patches +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Bugs can be reported using `Launchpad Bugs `_. + + +Security Issues +~~~~~~~~~~~~~~~ + +Reports about security issues can be made via `Tidelift `_. + + +Issues & Limitations +~~~~~~~~~~~~~~~~~~~~ + +- Offsets from UTC are rounded to the nearest whole minute, so timezones + such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This + is a limitation of the Python datetime library. + +- If you think a timezone definition is incorrect, I probably can't fix + it. pytz is a direct translation of the Olson timezone database, and + changes to the timezone definitions need to be made to this source. + If you find errors they should be reported to the time zone mailing + list, linked from http://www.iana.org/time-zones. + + +Further Reading +~~~~~~~~~~~~~~~ + +More info than you want to know about timezones: +http://www.twinsun.com/tz/tz-link.htm + + +Contact +~~~~~~~ + +Stuart Bishop + + diff -Nru python-tz-2019.3/README.txt python-tz-2020.1/README.txt --- python-tz-2019.3/README.txt 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,582 +0,0 @@ -pytz - World Timezone Definitions for Python -============================================ - -:Author: Stuart Bishop - -Introduction -~~~~~~~~~~~~ - -pytz brings the Olson tz database into Python. This library allows -accurate and cross platform timezone calculations using Python 2.4 -or higher. It also solves the issue of ambiguous times at the end -of daylight saving time, which you can read more about in the Python -Library Reference (``datetime.tzinfo``). - -Almost all of the Olson timezones are supported. - -.. note:: - - This library differs from the documented Python API for - tzinfo implementations; if you want to create local wallclock - times you need to use the ``localize()`` method documented in this - document. In addition, if you perform date arithmetic on local - times that cross DST boundaries, the result may be in an incorrect - timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get - 2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A - ``normalize()`` method is provided to correct this. Unfortunately these - issues cannot be resolved without modifying the Python datetime - implementation (see PEP-431). - - -Installation -~~~~~~~~~~~~ - -This package can either be installed using ``pip`` or from a tarball using the -standard Python distutils. - -If you are installing using ``pip``, you don't need to download anything as the -latest version will be downloaded for you from PyPI:: - - pip install pytz - -If you are installing from a tarball, run the following command as an -administrative user:: - - python setup.py install - - -Example & Usage -~~~~~~~~~~~~~~~ - -Localized times and date arithmetic ------------------------------------ - ->>> from datetime import datetime, timedelta ->>> from pytz import timezone ->>> import pytz ->>> utc = pytz.utc ->>> utc.zone -'UTC' ->>> eastern = timezone('US/Eastern') ->>> eastern.zone -'US/Eastern' ->>> amsterdam = timezone('Europe/Amsterdam') ->>> fmt = '%Y-%m-%d %H:%M:%S %Z%z' - -This library only supports two ways of building a localized time. The -first is to use the ``localize()`` method provided by the pytz library. -This is used to localize a naive datetime (datetime with no timezone -information): - ->>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0)) ->>> print(loc_dt.strftime(fmt)) -2002-10-27 06:00:00 EST-0500 - -The second way of building a localized time is by converting an existing -localized time using the standard ``astimezone()`` method: - ->>> ams_dt = loc_dt.astimezone(amsterdam) ->>> ams_dt.strftime(fmt) -'2002-10-27 12:00:00 CET+0100' - -Unfortunately using the tzinfo argument of the standard datetime -constructors ''does not work'' with pytz for many timezones. - ->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt) # /!\ Does not work this way! -'2002-10-27 12:00:00 LMT+0020' - -It is safe for timezones without daylight saving transitions though, such -as UTC: - ->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt) # /!\ Not recommended except for UTC -'2002-10-27 12:00:00 UTC+0000' - -The preferred way of dealing with times is to always work in UTC, -converting to localtime only when generating output to be read -by humans. - ->>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc) ->>> loc_dt = utc_dt.astimezone(eastern) ->>> loc_dt.strftime(fmt) -'2002-10-27 01:00:00 EST-0500' - -This library also allows you to do date arithmetic using local -times, although it is more complicated than working in UTC as you -need to use the ``normalize()`` method to handle daylight saving time -and other timezone transitions. In this example, ``loc_dt`` is set -to the instant when daylight saving time ends in the US/Eastern -timezone. - ->>> before = loc_dt - timedelta(minutes=10) ->>> before.strftime(fmt) -'2002-10-27 00:50:00 EST-0500' ->>> eastern.normalize(before).strftime(fmt) -'2002-10-27 01:50:00 EDT-0400' ->>> after = eastern.normalize(before + timedelta(minutes=20)) ->>> after.strftime(fmt) -'2002-10-27 01:10:00 EST-0500' - -Creating local times is also tricky, and the reason why working with -local times is not recommended. Unfortunately, you cannot just pass -a ``tzinfo`` argument when constructing a datetime (see the next -section for more details) - ->>> dt = datetime(2002, 10, 27, 1, 30, 0) ->>> dt1 = eastern.localize(dt, is_dst=True) ->>> dt1.strftime(fmt) -'2002-10-27 01:30:00 EDT-0400' ->>> dt2 = eastern.localize(dt, is_dst=False) ->>> dt2.strftime(fmt) -'2002-10-27 01:30:00 EST-0500' - -Converting between timezones is more easily done, using the -standard astimezone method. - ->>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899)) ->>> utc_dt.strftime(fmt) -'2006-03-26 21:34:59 UTC+0000' ->>> au_tz = timezone('Australia/Sydney') ->>> au_dt = utc_dt.astimezone(au_tz) ->>> au_dt.strftime(fmt) -'2006-03-27 08:34:59 AEDT+1100' ->>> utc_dt2 = au_dt.astimezone(utc) ->>> utc_dt2.strftime(fmt) -'2006-03-26 21:34:59 UTC+0000' ->>> utc_dt == utc_dt2 -True - -You can take shortcuts when dealing with the UTC side of timezone -conversions. ``normalize()`` and ``localize()`` are not really -necessary when there are no daylight saving time transitions to -deal with. - ->>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc) ->>> utc_dt.strftime(fmt) -'2006-03-26 21:34:59 UTC+0000' ->>> au_tz = timezone('Australia/Sydney') ->>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz)) ->>> au_dt.strftime(fmt) -'2006-03-27 08:34:59 AEDT+1100' ->>> utc_dt2 = au_dt.astimezone(utc) ->>> utc_dt2.strftime(fmt) -'2006-03-26 21:34:59 UTC+0000' - - -``tzinfo`` API --------------- - -The ``tzinfo`` instances returned by the ``timezone()`` function have -been extended to cope with ambiguous times by adding an ``is_dst`` -parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods. - ->>> tz = timezone('America/St_Johns') - ->>> normal = datetime(2009, 9, 1) ->>> ambiguous = datetime(2009, 10, 31, 23, 30) - -The ``is_dst`` parameter is ignored for most timestamps. It is only used -during DST transition ambiguous periods to resolve that ambiguity. - ->>> print(tz.utcoffset(normal, is_dst=True)) --1 day, 21:30:00 ->>> print(tz.dst(normal, is_dst=True)) -1:00:00 ->>> tz.tzname(normal, is_dst=True) -'NDT' - ->>> print(tz.utcoffset(ambiguous, is_dst=True)) --1 day, 21:30:00 ->>> print(tz.dst(ambiguous, is_dst=True)) -1:00:00 ->>> tz.tzname(ambiguous, is_dst=True) -'NDT' - ->>> print(tz.utcoffset(normal, is_dst=False)) --1 day, 21:30:00 ->>> tz.dst(normal, is_dst=False) -datetime.timedelta(0, 3600) ->>> tz.tzname(normal, is_dst=False) -'NDT' - ->>> print(tz.utcoffset(ambiguous, is_dst=False)) --1 day, 20:30:00 ->>> tz.dst(ambiguous, is_dst=False) -datetime.timedelta(0) ->>> tz.tzname(ambiguous, is_dst=False) -'NST' - -If ``is_dst`` is not specified, ambiguous timestamps will raise -an ``pytz.exceptions.AmbiguousTimeError`` exception. - ->>> print(tz.utcoffset(normal)) --1 day, 21:30:00 ->>> print(tz.dst(normal)) -1:00:00 ->>> tz.tzname(normal) -'NDT' - ->>> import pytz.exceptions ->>> try: -... tz.utcoffset(ambiguous) -... except pytz.exceptions.AmbiguousTimeError: -... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) -pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 ->>> try: -... tz.dst(ambiguous) -... except pytz.exceptions.AmbiguousTimeError: -... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) -pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 ->>> try: -... tz.tzname(ambiguous) -... except pytz.exceptions.AmbiguousTimeError: -... print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous) -pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00 - - -Problems with Localtime -~~~~~~~~~~~~~~~~~~~~~~~ - -The major problem we have to deal with is that certain datetimes -may occur twice in a year. For example, in the US/Eastern timezone -on the last Sunday morning in October, the following sequence -happens: - - - 01:00 EDT occurs - - 1 hour later, instead of 2:00am the clock is turned back 1 hour - and 01:00 happens again (this time 01:00 EST) - -In fact, every instant between 01:00 and 02:00 occurs twice. This means -that if you try and create a time in the 'US/Eastern' timezone -the standard datetime syntax, there is no way to specify if you meant -before of after the end-of-daylight-saving-time transition. Using the -pytz custom syntax, the best you can do is make an educated guess: - ->>> loc_dt = eastern.localize(datetime(2002, 10, 27, 1, 30, 00)) ->>> loc_dt.strftime(fmt) -'2002-10-27 01:30:00 EST-0500' - -As you can see, the system has chosen one for you and there is a 50% -chance of it being out by one hour. For some applications, this does -not matter. However, if you are trying to schedule meetings with people -in different timezones or analyze log files it is not acceptable. - -The best and simplest solution is to stick with using UTC. The pytz -package encourages using UTC for internal timezone representation by -including a special UTC implementation based on the standard Python -reference implementation in the Python documentation. - -The UTC timezone unpickles to be the same instance, and pickles to a -smaller size than other pytz tzinfo instances. The UTC implementation -can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC'). - ->>> import pickle, pytz ->>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc) ->>> naive = dt.replace(tzinfo=None) ->>> p = pickle.dumps(dt, 1) ->>> naive_p = pickle.dumps(naive, 1) ->>> len(p) - len(naive_p) -17 ->>> new = pickle.loads(p) ->>> new == dt -True ->>> new is dt -False ->>> new.tzinfo is dt.tzinfo -True ->>> pytz.utc is pytz.UTC is pytz.timezone('UTC') -True - -Note that some other timezones are commonly thought of as the same (GMT, -Greenwich, Universal, etc.). The definition of UTC is distinct from these -other timezones, and they are not equivalent. For this reason, they will -not compare the same in Python. - ->>> utc == pytz.timezone('GMT') -False - -See the section `What is UTC`_, below. - -If you insist on working with local times, this library provides a -facility for constructing them unambiguously: - ->>> loc_dt = datetime(2002, 10, 27, 1, 30, 00) ->>> est_dt = eastern.localize(loc_dt, is_dst=True) ->>> edt_dt = eastern.localize(loc_dt, is_dst=False) ->>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt)) -2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500 - -If you pass None as the is_dst flag to localize(), pytz will refuse to -guess and raise exceptions if you try to build ambiguous or non-existent -times. - -For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern -timezone when the clocks where put back at the end of Daylight Saving -Time: - ->>> dt = datetime(2002, 10, 27, 1, 30, 00) ->>> try: -... eastern.localize(dt, is_dst=None) -... except pytz.exceptions.AmbiguousTimeError: -... print('pytz.exceptions.AmbiguousTimeError: %s' % dt) -pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00 - -Similarly, 2:30am on 7th April 2002 never happened at all in the -US/Eastern timezone, as the clocks where put forward at 2:00am skipping -the entire hour: - ->>> dt = datetime(2002, 4, 7, 2, 30, 00) ->>> try: -... eastern.localize(dt, is_dst=None) -... except pytz.exceptions.NonExistentTimeError: -... print('pytz.exceptions.NonExistentTimeError: %s' % dt) -pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00 - -Both of these exceptions share a common base class to make error handling -easier: - ->>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError) -True ->>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError) -True - - -A special case is where countries change their timezone definitions -with no daylight savings time switch. For example, in 1915 Warsaw -switched from Warsaw time to Central European time with no daylight savings -transition. So at the stroke of midnight on August 5th 1915 the clocks -were wound back 24 minutes creating an ambiguous time period that cannot -be specified without referring to the timezone abbreviation or the -actual UTC offset. In this case midnight happened twice, neither time -during a daylight saving time period. pytz handles this transition by -treating the ambiguous period before the switch as daylight savings -time, and the ambiguous period after as standard time. - - ->>> warsaw = pytz.timezone('Europe/Warsaw') ->>> amb_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=True) ->>> amb_dt1.strftime(fmt) -'1915-08-04 23:59:59 WMT+0124' ->>> amb_dt2 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False) ->>> amb_dt2.strftime(fmt) -'1915-08-04 23:59:59 CET+0100' ->>> switch_dt = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False) ->>> switch_dt.strftime(fmt) -'1915-08-05 00:00:00 CET+0100' ->>> str(switch_dt - amb_dt1) -'0:24:01' ->>> str(switch_dt - amb_dt2) -'0:00:01' - -The best way of creating a time during an ambiguous time period is -by converting from another timezone such as UTC: - ->>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc) ->>> utc_dt.astimezone(warsaw).strftime(fmt) -'1915-08-04 23:36:00 CET+0100' - -The standard Python way of handling all these ambiguities is not to -handle them, such as demonstrated in this example using the US/Eastern -timezone definition from the Python documentation (Note that this -implementation only works for dates between 1987 and 2006 - it is -included for tests only!): - ->>> from pytz.reference import Eastern # pytz.reference only for tests ->>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern) ->>> str(dt) -'2002-10-27 00:30:00-04:00' ->>> str(dt + timedelta(hours=1)) -'2002-10-27 01:30:00-05:00' ->>> str(dt + timedelta(hours=2)) -'2002-10-27 02:30:00-05:00' ->>> str(dt + timedelta(hours=3)) -'2002-10-27 03:30:00-05:00' - -Notice the first two results? At first glance you might think they are -correct, but taking the UTC offset into account you find that they are -actually two hours appart instead of the 1 hour we asked for. - ->>> from pytz.reference import UTC # pytz.reference only for tests ->>> str(dt.astimezone(UTC)) -'2002-10-27 04:30:00+00:00' ->>> str((dt + timedelta(hours=1)).astimezone(UTC)) -'2002-10-27 06:30:00+00:00' - - -Country Information -~~~~~~~~~~~~~~~~~~~ - -A mechanism is provided to access the timezones commonly in use -for a particular country, looked up using the ISO 3166 country code. -It returns a list of strings that can be used to retrieve the relevant -tzinfo instance using ``pytz.timezone()``: - ->>> print(' '.join(pytz.country_timezones['nz'])) -Pacific/Auckland Pacific/Chatham - -The Olson database comes with a ISO 3166 country code to English country -name mapping that pytz exposes as a dictionary: - ->>> print(pytz.country_names['nz']) -New Zealand - - -What is UTC -~~~~~~~~~~~ - -'UTC' is `Coordinated Universal Time`_. It is a successor to, but distinct -from, Greenwich Mean Time (GMT) and the various definitions of Universal -Time. UTC is now the worldwide standard for regulating clocks and time -measurement. - -All other timezones are defined relative to UTC, and include offsets like -UTC+0800 - hours to add or subtract from UTC to derive the local time. No -daylight saving time occurs in UTC, making it a useful timezone to perform -date arithmetic without worrying about the confusion and ambiguities caused -by daylight saving time transitions, your country changing its timezone, or -mobile computers that roam through multiple timezones. - -.. _Coordinated Universal Time: https://en.wikipedia.org/wiki/Coordinated_Universal_Time - - -Helpers -~~~~~~~ - -There are two lists of timezones provided. - -``all_timezones`` is the exhaustive list of the timezone names that can -be used. - ->>> from pytz import all_timezones ->>> len(all_timezones) >= 500 -True ->>> 'Etc/Greenwich' in all_timezones -True - -``common_timezones`` is a list of useful, current timezones. It doesn't -contain deprecated zones or historical zones, except for a few I've -deemed in common usage, such as US/Eastern (open a bug report if you -think other timezones are deserving of being included here). It is also -a sequence of strings. - ->>> from pytz import common_timezones ->>> len(common_timezones) < len(all_timezones) -True ->>> 'Etc/Greenwich' in common_timezones -False ->>> 'Australia/Melbourne' in common_timezones -True ->>> 'US/Eastern' in common_timezones -True ->>> 'Canada/Eastern' in common_timezones -True ->>> 'Australia/Yancowinna' in all_timezones -True ->>> 'Australia/Yancowinna' in common_timezones -False - -Both ``common_timezones`` and ``all_timezones`` are alphabetically -sorted: - ->>> common_timezones_dupe = common_timezones[:] ->>> common_timezones_dupe.sort() ->>> common_timezones == common_timezones_dupe -True ->>> all_timezones_dupe = all_timezones[:] ->>> all_timezones_dupe.sort() ->>> all_timezones == all_timezones_dupe -True - -``all_timezones`` and ``common_timezones`` are also available as sets. - ->>> from pytz import all_timezones_set, common_timezones_set ->>> 'US/Eastern' in all_timezones_set -True ->>> 'US/Eastern' in common_timezones_set -True ->>> 'Australia/Victoria' in common_timezones_set -False - -You can also retrieve lists of timezones used by particular countries -using the ``country_timezones()`` function. It requires an ISO-3166 -two letter country code. - ->>> from pytz import country_timezones ->>> print(' '.join(country_timezones('ch'))) -Europe/Zurich ->>> print(' '.join(country_timezones('CH'))) -Europe/Zurich - - -Internationalization - i18n/l10n -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Pytz is an interface to the IANA database, which uses ASCII names. The `Unicode Consortium's Unicode Locales (CLDR) `_ -project provides translations. Thomas Khyn's -`l18n `_ package can be used to access -these translations from Python. - - -License -~~~~~~~ - -MIT license. - -This code is also available as part of Zope 3 under the Zope Public -License, Version 2.1 (ZPL). - -I'm happy to relicense this code if necessary for inclusion in other -open source projects. - - -Latest Versions -~~~~~~~~~~~~~~~ - -This package will be updated after releases of the Olson timezone -database. The latest version can be downloaded from the `Python Package -Index `_. The code that is used -to generate this distribution is hosted on launchpad.net and available -using git:: - - git clone https://git.launchpad.net/pytz - -A mirror on github is also available at https://github.com/stub42/pytz - -Announcements of new releases are made on -`Launchpad `_, and the -`Atom feed `_ -hosted there. - - -Bugs, Feature Requests & Patches -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Bugs can be reported using `Launchpad `__. - - -Issues & Limitations -~~~~~~~~~~~~~~~~~~~~ - -- Offsets from UTC are rounded to the nearest whole minute, so timezones - such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This - is a limitation of the Python datetime library. - -- If you think a timezone definition is incorrect, I probably can't fix - it. pytz is a direct translation of the Olson timezone database, and - changes to the timezone definitions need to be made to this source. - If you find errors they should be reported to the time zone mailing - list, linked from http://www.iana.org/time-zones. - - -Further Reading -~~~~~~~~~~~~~~~ - -More info than you want to know about timezones: -http://www.twinsun.com/tz/tz-link.htm - - -Contact -~~~~~~~ - -Stuart Bishop - - diff -Nru python-tz-2019.3/setup.cfg python-tz-2020.1/setup.cfg --- python-tz-2019.3/setup.cfg 2019-10-07 03:17:43.000000000 +0000 +++ python-tz-2020.1/setup.cfg 2020-05-19 09:44:45.000000000 +0000 @@ -1,6 +1,9 @@ [metadata] license_file = LICENSE.txt +[flake8] +max-line-length = 120 + [egg_info] tag_build = tag_date = 0 diff -Nru python-tz-2019.3/setup.py python-tz-2020.1/setup.py --- python-tz-2019.3/setup.py 2019-10-07 03:10:40.000000000 +0000 +++ python-tz-2020.1/setup.py 2020-05-19 09:44:45.000000000 +0000 @@ -29,7 +29,7 @@ version=pytz.VERSION, zip_safe=True, description='World timezone definitions, modern and historical', - long_description=open('README.txt', 'r').read(), + long_description=open('README.rst', 'r').read(), author=me, author_email=memail, maintainer=me,