Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pendulum.tz.timezones() to use system tzdata #801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgorny
Copy link

@mgorny mgorny commented Feb 2, 2024

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

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

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 sdispater#769
@mgorny
Copy link
Author

mgorny commented Mar 13, 2024

Gentle ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use system provided tzdata as a priority
1 participant