Fix pendulum.tz.timezones() to use system tzdata#801
Merged
Secrus merged 5 commits intopython-pendulum:masterfrom Mar 31, 2025
Merged
Fix pendulum.tz.timezones() to use system tzdata#801Secrus merged 5 commits intopython-pendulum:masterfrom
pendulum.tz.timezones() to use system tzdata#801Secrus merged 5 commits intopython-pendulum:masterfrom
Conversation
Contributor
Author
|
Gentle ping. |
Collaborator
|
@mgorny could you please rebase? |
Contributor
Author
I can. But since you've already merged |
Collaborator
|
Hey @mgorny sorry for the delays and merge/rebase mess. I would appreciate a rebase (I won't interfere this time 🙈). |
Secrus
approved these changes
Mar 31, 2025
dvzrv
reviewed
Mar 31, 2025
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
CodSpeed Performance ReportMerging #801 will not alter performanceComparing Summary
|
Contributor
Author
|
Rebased, fixed typing and ruff lints, implemented suggestions from @dvzrv. |
Secrus
approved these changes
Mar 31, 2025
Collaborator
Secrus
left a comment
There was a problem hiding this comment.
Looks good to me, thank you for your work!
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the
pendulum.tz.available_timezones()to useavailable_timezones()function instead of iterating over the files intzdatapackage. This is more in line with PEP 615, as the system timezone functions will operate on system-provided tzdata when available, and use thetzdatapackage 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
tzdatapackage 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