Avatar for the python-pendulum user
python-pendulum
pendulum
BlogDocsChangelog

Fix `pendulum.tz.timezones()` to use system tzdata

#801Merged
Comparing
mgorny:system-tzdata
(
02890eb
) with
master
(
6705906
)
CodSpeed Performance Gauge
0%
Untouched
1

Benchmarks

Passed

test_parse_iso8601
tests/benchmarks/test_parse_8601.py::test_parse_iso8601
CodSpeed Performance Gauge
0%
14.4 ms14.4 ms

Commits

Click on a commit to change the comparison range
Base
master
6705906
-0.11%
Fix `pendulum.tz.timezones()` to use system tzdata Fix the `pendulum.tz.available_timezones()` to use `available_timezones()` function instead of iterating over the files in `tzdata` package. This is more in line with PEP 615, as the system timezone functions will operate on system-provided tzdata when available, and use the `tzdata` package only if it's not available. Therefore, the previous code would yield a potentially different list of timezones than the system actually provides. Furthermore, Gentoo provides a dummy `tzdata` package that does not provide any data, since Python always uses system tzdata. This change is necessary to make pendulum work again on Gentoo. Fixes #769
fe0b356
2 years ago
by mgorny
+0.04%
Add caching to `timezones()`
02890eb
6 months ago
by mgorny
© 2025 CodSpeed Technology
Home Terms Privacy Docs