Use resource loader for zoneinfo files
Bug #1834363 reported by
Peter Baumgartner
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pytz |
New
|
Undecided
|
Unassigned |
Bug Description
I'd like to use pytz in a project and package it with PyOxidizer for distribution. The use of __file__ to find the zoneinfo files is problematic. If they could be read with a resource loader instead, it would prevent this issue.
More info on the issue and resolution is here: https:/
To post a comment you must log in.
Bug #383171 contains relevant history here. Currently the code attempts to locate the zoneinfo files using __file__, falling back to pkg_resources if it fails. I'd need a patch that works for Python2.4+ (or drop obsolete Python support, which I hadn't planned to do as pytz is maintenance only).
See open_resource in pytz/__init__.py for the relevant code.