As part of the implementation of IANA time zone support in the Python standard library (which is now accepted for inclusion in Python 3.9 — many thanks to those who commented on the original proposal), I realized that likely a common feature request is to get the list of time zones installed in the system. I have a candidate implementation for this, which basically walks each potential install directory (there's a "time zone search path" equivalent to PATH) and populates a list of every file installed there which starts with the `TZif` magic string.
The problem I'm running into is that tzcode installs `posix/` and
`right/` folders, so for each entry in zoneinfo, I get three
entries: "Africa/Abidjan", "posix/Africa/Abidjan" and
"right/Africa/Abidjan". I'm also seeing a `posixrules` zone in the
zoneinfo root.
My questions are:
1. Is there a better source for the list of installed time zones
(leaving aside `tzdata.zi`, which I don't think I can count on to
exist in all environments).
2. Is there any stable and standard way to distinguish between
proper zones and other things that are also zone files like
posixrules and right/ and posix/?
In my own redistribution of the data, I populate a list of zones
from `make zonenames`, which I note does not include
posix/, right/ or posixrules, but I don't think that information
is included in standard distributions of zoneinfo. The closest I
can find is `zone1970.tab` and `zone.tab` (which I think is not
even always included), and that appears to be only a subset of the
output of `make zonenames`.
Thanks,
Paul