-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Use system provided tzdata as a priority #769
Comments
In fact, it's a violation of PEP 615 and as such, the package can't work on PEP 615-conformant Linux distributions that do not provide vendored tzdata, such as Gentoo. |
Also, I think the bug report is about 3.0.0. |
To be honest, I can't figure out what this is supposed to do. It seems to grab the list of timezones from |
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
I am on the latest Pendulum version.
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: Ubuntu 22.04
Pendulum version: 2.1.2
Issue
Pendulum uses
tzdata
package and imports the tzdata in https://github.com/sdispater/pendulum/blob/75a87a4e3cab45c5f9c38ca6060a54337dcadd09/src/pendulum/tz/__init__.py#L28However,
tzdata
package's docs state:Should Pendulum rather look into system provided files first, and only resort to
tzdata
if the data is not found?It's of course easier to just import from Python's
tzdata
package. Simiarly, if system provided data was used as a priority, then there would be need for a mechanism to override the system-provided data with Python'stzdata
package (if OS provided tzdata is too old / incomplete).So, might not be actionable.
The text was updated successfully, but these errors were encountered: