zoneinfo files provided with the pytzdata package are not installed: > ❯ ebuild $(ew dev-python/pytzdata) clean unpack > * pytzdata-2020.1.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ] > * checking ebuild checksums ;-) ... [ ok ] > * checking miscfile checksums ;-) ... [ ok ] > >>> Unpacking source... > >>> Unpacking pytzdata-2020.1.tar.gz to /var/tmp/portage/dev-python/pytzdata-2020.1/work > >>> Source unpacked in /var/tmp/portage/dev-python/pytzdata-2020.1/work > > ❯ ls /var/tmp/portage/dev-python/pytzdata-2020.1/work/pytzdata-2020.1/pytzdata/zoneinfo > Africa Arctic Australia Chile Indian US Cuba Eire Factory GMT GMT0 HST iso3166.tab Japan Libya MST7MDT NZ-CHAT posixrules ROC Turkey Universal W-SU Zulu > America Asia Brazil Etc Mexico CET EET EST GB GMT+0 Greenwich Iceland Israel Kwajalein MET Navajo Poland PRC ROK tzdata.zi UTC zone1970.tab > Antarctica Atlantic Canada Europe Pacific CST6CDT Egypt EST5EDT GB-Eire GMT-0 Hongkong Iran Jamaica leapseconds MST NZ Portugal PST8PDT Singapore UCT WET zone.tab > > ❯ =emerge -pvqO dev-python/pytzdata > [ebuild R ] dev-python/pytzdata-2020.1 USE="-test" PYTHON_TARGETS="python3_9 -python3_10 -python3_8" > > ❯ qlist dev-python/pytzdata | grep zoneinfo > (no output) Because of this, attempting to use the package as-is causes failure as it defaults to using its self-provided zoneinfo: > python3 > Python 3.9.6 (default, Jun 30 2021, 10:20:12) > [GCC 11.1.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import pytzdata > >>> pytzdata.tz_file('Australia/Sydney') > Traceback (most recent call last): > File "/usr/lib/python3.9/site-packages/pytzdata/__init__.py", line 32, in tz_file > filepath = tz_path(name) > File "/usr/lib/python3.9/site-packages/pytzdata/__init__.py", line 74, in tz_path > raise TimezoneNotFound('Timezone {} not found at {}'.format(name, filepath)) > pytzdata.exceptions.TimezoneNotFound: Timezone Australia/Sydney not found at /usr/lib/python3.9/site-packages/pytzdata/zoneinfo/Australia/Sydney > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/lib/python3.9/site-packages/pytzdata/__init__.py", line 46, in tz_file > return resource_stream(__name__, 'zoneinfo/' + name) > File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1136, in resource_stream > return get_provider(package_or_requirement).get_resource_stream( > File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1608, in get_resource_stream > return open(self._fn(self.module_path, resource_name), 'rb') > FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.9/site-packages/pytzdata/zoneinfo/Australia/Sydney' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/lib/python3.9/site-packages/pytzdata/__init__.py", line 48, in tz_file > return tz_path(name) > File "/usr/lib/python3.9/site-packages/pytzdata/__init__.py", line 74, in tz_path > raise TimezoneNotFound('Timezone {} not found at {}'.format(name, filepath)) > pytzdata.exceptions.TimezoneNotFound: Timezone Australia/Sydney not found at /usr/lib/python3.9/site-packages/pytzdata/zoneinfo/Australia/Sydney This can be worked around by instructing the package to use the system zoneinfo files: > PYTZDATA_TZDATADIR=/usr/share/zoneinfo python3 > Python 3.9.6 (default, Jun 30 2021, 10:20:12) > [GCC 11.1.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import pytzdata > >>> pytzdata.tz_file('Australia/Sydney') > <_io.BufferedReader name='/usr/share/zoneinfo/Australia/Sydney'> Are the zoneinfo data files intentionally not being installed? If so, then ideally either the default data path should be updated to use the system zoneinfo files so the module functions correctly by default, or at least a postinst message should be shown noting that the PYTZDATA_TZDATADIR environment variable must be set for the module to be used. If not, then an extra step may be required in the ebuild to install the data files to the appropriate location for each python implementation being built for.
Eh, another half-broken NIH package suite...
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03b481085bc20e6c9ea57a15335054256eb33cb4 commit 03b481085bc20e6c9ea57a15335054256eb33cb4 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2021-07-09 08:19:33 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2021-07-09 14:44:15 +0000 dev-python/pytzdata: Use system zoneinfo by default Closes: https://bugs.gentoo.org/801280 Signed-off-by: Michał Górny <mgorny@gentoo.org> .../files/pytzdata-2020.1-system-zoneinfo.patch | 115 +++++++++++++++++++++ ...ata-2020.1.ebuild => pytzdata-2020.1-r1.ebuild} | 9 +- 2 files changed, 121 insertions(+), 3 deletions(-)