zoneinfo not working properly

Terry Reedy tjreedy at udel.edu
Sun Jul 18 19:44:13 EDT 2021


On 7/18/2021 1:44 AM, Shashank Jain wrote:
> I was using python 3.9.3 then zoneinfo library was working fine without any
> issues. but now after installing 3.9.6 there are problems.  Ex.
> 
> Using below code there no outputs. and further there are issues while
> working with timezones with zoninfo  where I tried same things with pytz
> that was giving correct output.
> 
> for i in zoneinfo.available_timezones():
>      print(i)

https://docs.python.org/3/library/zoneinfo.html#data-sources
starts with "The zoneinfo module does not directly provide time zone 
data, and instead pulls time zone information from the system time zone 
database or the first-party PyPI package tzdata, if available."

Somehow and for some reason, it is no longer getting the data.   So I 
suggest reading the section to see if you can determine why.  If 3.9.6 
is a separate installation from the 3.9.3, rather than an upgrade 
thereof, then maybe you need to install tzdata for the new installation.

Being on Windows, where this is not available, I cannot help further.

-- 
Terry Jan Reedy



More information about the Python-list mailing list