set(all_timezones_set) returns empty unless called after all_timezones_set

Bug #1900081 reported by Deep Chowdhury
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytz
Triaged
Undecided
Unassigned

Bug Description

The set(all_timezones_set) return empty unless we call just all_timezones_set once.
Once we call all_timezones_set, the set(all_timezones_set) also gets populated and works fine.

>>> import pytz
>>> set(pytz.all_timezones_set)
set()
>>> 'Asia/Dubai' in set(pytz.all_timezones_set)
False
>>> 'Asia/Dubai' in pytz.all_timezones_set
True
>>> 'Asia/Dubai' in set(pytz.all_timezones_set)
True

pytz version: 2020.1
python version: 3.7.3

Revision history for this message
Stuart Bishop (stub) wrote :

I think this is https://bugs.launchpad.net/pytz/+bug/1435617 again, which I don't think can be fixed for older Python versions. It may be possible to drop lazy.py with newer Python and an alternative lazy loading mechanism.

Changed in pytz:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.