pganssle / zoneinfo

Reference implementation for the proposed standard library module zoneinfo
Other
52 stars 20 forks source link

DeprecationWarning due to `resources.open_text` #109

Open alexprengere opened 3 years ago

alexprengere commented 3 years ago

Not really a bug, so feel free to close without further explanations. Not too long ago I started seeing this deprecation warning from _tzpath.py:152

DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with resources.open_text("tzdata", "zones") as f:
dvarrazzo commented 2 years ago

This also causes an error when using -W error. And for some mysterious reason a segfault in psycopg 3 (which can be addressed by catching the error).

alexprengere commented 2 years ago

A simple way to avoid the warnings would be to use importlib_resources<5.3;python_version<"3.7" in the setup.cfg, as this version of the backport does not raise them.