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 2 commits 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 python-pendulum#769
@mgorny
Copy link
Author

mgorny commented Mar 13, 2024

Gentle ping.

@Secrus Secrus closed this Dec 17, 2024
@Secrus Secrus reopened this Dec 17, 2024
@Secrus
Copy link
Collaborator

Secrus commented Dec 17, 2024

@mgorny could you please rebase?

@mgorny
Copy link
Author

mgorny commented Dec 18, 2024

@mgorny could you please rebase?

I can. But since you've already merged master into it, could you confirm that you still want me to rebase?

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
2 participants