[Bug 207604] Re: pytz includes a hard coded list of time zone names
Robie Basak
207604 at bugs.launchpad.net
Thu Mar 30 14:13:37 UTC 2023
The fix seems appropriate for the development release - thanks to all
involved for helping with this!
SRU review for proposed fixes for Jammy and Kinetic: could we be clear
about what broken user experience we are seeking to fix here in Ubuntu
Jammy and Kinetic specifically? Bug 1995864 is reported as fixed in
Jammy. So what is the broken user story that we are fixing with this
update?
** Changed in: python-tz (Ubuntu Jammy)
Status: New => Incomplete
** Changed in: python-tz (Ubuntu Kinetic)
Status: New => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/207604
Title:
pytz includes a hard coded list of time zone names
Status in pytz:
New
Status in python-tz package in Ubuntu:
Fix Released
Status in python-tz source package in Jammy:
Incomplete
Status in python-tz source package in Kinetic:
Incomplete
Bug description:
[ Impact ]
The Debian/Ubuntu packages of pytz include a patch to not install
pytz's zoneinfo database and instead load data from the system
zoneinfo database. This keeps pytz up to date when system timezone
updates are installed which is generally a good idea.
The pytz/__init__.py includes common_timezones and all_timezones
lists, which enumerate the time zones in the database pytz was
released with. If pytz is instead using the system database, these
lists may not be correct (e.g. missing newly added time zones).
all_timezones and common_timezones should be calculated at run time.
all_timezones will need to use os.walk to discover what timezones
exist. common_timezones should be loaded from zone.tab, plus a hard
coded list of extras such as UTC and US/Eastern.
[ Test Plan ]
Two autopkgtest test cases were added:
1. Run the upstream unittests
2. Regression tests with all tests that I could come up with.
There are no manual test, because all those test should also be run
when there is a tzdata update to prevent regressions.
[ Where problems could occur ]
Dynamically determine the timezones relies on a correct environment
and can fail more easily if the environment is broken. python-tz is
used in several places (maybe in the installer). The patch might have
a performance impact, because the list of timezones is determined
completely (but only once) instead of constructing it lazy.
[ Other Info ]
Upstream recommend our approach:
https://github.com/stub42/pytz/issues/91#issuecomment-1356628324
To manage notifications about this bug go to:
https://bugs.launchpad.net/pytz/+bug/207604/+subscriptions
More information about the foundations-bugs
mailing list