mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
Update pytz-2021.3
This commit is contained in:
parent
d76838a607
commit
9d78e6ae4c
122 changed files with 327 additions and 278 deletions
|
@ -22,8 +22,8 @@ from pytz.tzfile import build_tzinfo
|
||||||
|
|
||||||
|
|
||||||
# The IANA (nee Olson) database is updated several times a year.
|
# The IANA (nee Olson) database is updated several times a year.
|
||||||
OLSON_VERSION = '2019c'
|
OLSON_VERSION = '2021c'
|
||||||
VERSION = '2019.3' # pip compatible version number.
|
VERSION = '2021.3' # pip compatible version number.
|
||||||
__version__ = VERSION
|
__version__ = VERSION
|
||||||
|
|
||||||
OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
|
OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
|
||||||
|
@ -34,7 +34,7 @@ __all__ = [
|
||||||
'NonExistentTimeError', 'UnknownTimeZoneError',
|
'NonExistentTimeError', 'UnknownTimeZoneError',
|
||||||
'all_timezones', 'all_timezones_set',
|
'all_timezones', 'all_timezones_set',
|
||||||
'common_timezones', 'common_timezones_set',
|
'common_timezones', 'common_timezones_set',
|
||||||
'BaseTzInfo',
|
'BaseTzInfo', 'FixedOffset',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,6 +111,13 @@ def open_resource(name):
|
||||||
def resource_exists(name):
|
def resource_exists(name):
|
||||||
"""Return true if the given resource exists"""
|
"""Return true if the given resource exists"""
|
||||||
try:
|
try:
|
||||||
|
if os.environ.get('PYTZ_SKIPEXISTSCHECK', ''):
|
||||||
|
# In "standard" distributions, we can assume that
|
||||||
|
# all the listed timezones are present. As an
|
||||||
|
# import-speed optimization, you can set the
|
||||||
|
# PYTZ_SKIPEXISTSCHECK flag to skip checking
|
||||||
|
# for the presence of the resource file on disk.
|
||||||
|
return True
|
||||||
open_resource(name).close()
|
open_resource(name).close()
|
||||||
return True
|
return True
|
||||||
except IOError:
|
except IOError:
|
||||||
|
@ -263,8 +270,8 @@ def _UTC():
|
||||||
module global.
|
module global.
|
||||||
|
|
||||||
These examples belong in the UTC class above, but it is obscured; or in
|
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.rst, 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 examples with the unit tests is not trivial.
|
||||||
|
|
||||||
>>> import datetime, pickle
|
>>> import datetime, pickle
|
||||||
>>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
|
>>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
|
||||||
|
@ -683,6 +690,7 @@ all_timezones = \
|
||||||
'America/North_Dakota/Beulah',
|
'America/North_Dakota/Beulah',
|
||||||
'America/North_Dakota/Center',
|
'America/North_Dakota/Center',
|
||||||
'America/North_Dakota/New_Salem',
|
'America/North_Dakota/New_Salem',
|
||||||
|
'America/Nuuk',
|
||||||
'America/Ojinaga',
|
'America/Ojinaga',
|
||||||
'America/Panama',
|
'America/Panama',
|
||||||
'America/Pangnirtung',
|
'America/Pangnirtung',
|
||||||
|
@ -1050,6 +1058,7 @@ all_timezones = \
|
||||||
'Pacific/Guam',
|
'Pacific/Guam',
|
||||||
'Pacific/Honolulu',
|
'Pacific/Honolulu',
|
||||||
'Pacific/Johnston',
|
'Pacific/Johnston',
|
||||||
|
'Pacific/Kanton',
|
||||||
'Pacific/Kiritimati',
|
'Pacific/Kiritimati',
|
||||||
'Pacific/Kosrae',
|
'Pacific/Kosrae',
|
||||||
'Pacific/Kwajalein',
|
'Pacific/Kwajalein',
|
||||||
|
@ -1210,7 +1219,6 @@ common_timezones = \
|
||||||
'America/Fort_Nelson',
|
'America/Fort_Nelson',
|
||||||
'America/Fortaleza',
|
'America/Fortaleza',
|
||||||
'America/Glace_Bay',
|
'America/Glace_Bay',
|
||||||
'America/Godthab',
|
|
||||||
'America/Goose_Bay',
|
'America/Goose_Bay',
|
||||||
'America/Grand_Turk',
|
'America/Grand_Turk',
|
||||||
'America/Grenada',
|
'America/Grenada',
|
||||||
|
@ -1264,6 +1272,7 @@ common_timezones = \
|
||||||
'America/North_Dakota/Beulah',
|
'America/North_Dakota/Beulah',
|
||||||
'America/North_Dakota/Center',
|
'America/North_Dakota/Center',
|
||||||
'America/North_Dakota/New_Salem',
|
'America/North_Dakota/New_Salem',
|
||||||
|
'America/Nuuk',
|
||||||
'America/Ojinaga',
|
'America/Ojinaga',
|
||||||
'America/Panama',
|
'America/Panama',
|
||||||
'America/Pangnirtung',
|
'America/Pangnirtung',
|
||||||
|
@ -1412,7 +1421,6 @@ common_timezones = \
|
||||||
'Australia/Adelaide',
|
'Australia/Adelaide',
|
||||||
'Australia/Brisbane',
|
'Australia/Brisbane',
|
||||||
'Australia/Broken_Hill',
|
'Australia/Broken_Hill',
|
||||||
'Australia/Currie',
|
|
||||||
'Australia/Darwin',
|
'Australia/Darwin',
|
||||||
'Australia/Eucla',
|
'Australia/Eucla',
|
||||||
'Australia/Hobart',
|
'Australia/Hobart',
|
||||||
|
@ -1506,7 +1514,6 @@ common_timezones = \
|
||||||
'Pacific/Chuuk',
|
'Pacific/Chuuk',
|
||||||
'Pacific/Easter',
|
'Pacific/Easter',
|
||||||
'Pacific/Efate',
|
'Pacific/Efate',
|
||||||
'Pacific/Enderbury',
|
|
||||||
'Pacific/Fakaofo',
|
'Pacific/Fakaofo',
|
||||||
'Pacific/Fiji',
|
'Pacific/Fiji',
|
||||||
'Pacific/Funafuti',
|
'Pacific/Funafuti',
|
||||||
|
@ -1515,6 +1522,7 @@ common_timezones = \
|
||||||
'Pacific/Guadalcanal',
|
'Pacific/Guadalcanal',
|
||||||
'Pacific/Guam',
|
'Pacific/Guam',
|
||||||
'Pacific/Honolulu',
|
'Pacific/Honolulu',
|
||||||
|
'Pacific/Kanton',
|
||||||
'Pacific/Kiritimati',
|
'Pacific/Kiritimati',
|
||||||
'Pacific/Kosrae',
|
'Pacific/Kosrae',
|
||||||
'Pacific/Kwajalein',
|
'Pacific/Kwajalein',
|
||||||
|
|
|
@ -8,7 +8,11 @@ __all__ = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
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.
|
'''Exception raised when pytz is passed an unknown timezone.
|
||||||
|
|
||||||
>>> isinstance(UnknownTimeZoneError(), LookupError)
|
>>> isinstance(UnknownTimeZoneError(), LookupError)
|
||||||
|
@ -20,11 +24,18 @@ class UnknownTimeZoneError(KeyError):
|
||||||
|
|
||||||
>>> isinstance(UnknownTimeZoneError(), KeyError)
|
>>> isinstance(UnknownTimeZoneError(), KeyError)
|
||||||
True
|
True
|
||||||
|
|
||||||
|
And also a subclass of pytz.exceptions.Error, as are other pytz
|
||||||
|
exceptions.
|
||||||
|
|
||||||
|
>>> isinstance(UnknownTimeZoneError(), Error)
|
||||||
|
True
|
||||||
|
|
||||||
'''
|
'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class InvalidTimeError(Exception):
|
class InvalidTimeError(Error):
|
||||||
'''Base class for invalid time exceptions.'''
|
'''Base class for invalid time exceptions.'''
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,12 @@ import sys
|
||||||
|
|
||||||
THIS_DIR = os.path.dirname(__file__)
|
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):
|
class DocumentationTestCase(unittest.TestCase):
|
||||||
def test_readme_encoding(self):
|
def test_readme_encoding(self):
|
||||||
'''Confirm the README.txt is pure ASCII.'''
|
'''Confirm the README.rst is ASCII.'''
|
||||||
f = open(README, 'rb')
|
f = open(README, 'rb')
|
||||||
try:
|
try:
|
||||||
f.read().decode('ASCII')
|
f.read().decode('ASCII')
|
||||||
|
@ -24,7 +24,7 @@ def test_suite():
|
||||||
"For the Z3 test runner"
|
"For the Z3 test runner"
|
||||||
return unittest.TestSuite((
|
return unittest.TestSuite((
|
||||||
DocumentationTestCase('test_readme_encoding'),
|
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__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -27,8 +27,8 @@ from pytz.tzinfo import DstTzInfo, StaticTzInfo # noqa
|
||||||
|
|
||||||
# I test for expected version to ensure the correct version of pytz is
|
# I test for expected version to ensure the correct version of pytz is
|
||||||
# actually being tested.
|
# actually being tested.
|
||||||
EXPECTED_VERSION = '2019.3'
|
EXPECTED_VERSION = '2021.3'
|
||||||
EXPECTED_OLSON_VERSION = '2019c'
|
EXPECTED_OLSON_VERSION = '2021c'
|
||||||
|
|
||||||
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
|
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
|
||||||
|
|
||||||
|
@ -859,6 +859,7 @@ def test_suite():
|
||||||
suite = unittest.TestSuite()
|
suite = unittest.TestSuite()
|
||||||
suite.addTest(doctest.DocTestSuite('pytz'))
|
suite.addTest(doctest.DocTestSuite('pytz'))
|
||||||
suite.addTest(doctest.DocTestSuite('pytz.tzinfo'))
|
suite.addTest(doctest.DocTestSuite('pytz.tzinfo'))
|
||||||
|
suite.addTest(doctest.DocTestSuite('pytz.exceptions'))
|
||||||
import test_tzinfo
|
import test_tzinfo
|
||||||
suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_tzinfo))
|
suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_tzinfo))
|
||||||
return suite
|
return suite
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
'''
|
'''
|
||||||
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
|
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
|
||||||
'''
|
'''
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/pytz/zoneinfo/America/Nuuk
Normal file
BIN
lib/pytz/zoneinfo/America/Nuuk
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue