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

DeprecationWarning due to resources.open_text #109

Open
alexprengere opened this issue Oct 25, 2021 · 2 comments
Open

DeprecationWarning due to resources.open_text #109

alexprengere opened this issue Oct 25, 2021 · 2 comments

Comments

@alexprengere
Copy link

alexprengere commented Oct 25, 2021

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 added a commit to psycopg/psycopg that referenced this issue Nov 13, 2021
Also fix a couple of attribute errors in less used code paths (in the
branches reporting errors when using unsupported datestyles).

Related: pganssle/zoneinfo#109
@dvarrazzo
Copy link

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
Copy link
Author

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.

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

No branches or pull requests

2 participants