Skip to content

DeprecationWarning for use of legacy importlib_resources API #184

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

Closed
bskinn opened this issue Jan 26, 2022 · 1 comment
Closed

DeprecationWarning for use of legacy importlib_resources API #184

bskinn opened this issue Jan 26, 2022 · 1 comment

Comments

@bskinn
Copy link

bskinn commented Jan 26, 2022

I'm seeing a DeprecationWarning in my tox matrix for bskinn/sphobjinv running with Python 3.11.0a4, which appears to be due to certifi's use of a legacy API from importlib_resources.

In a fresh virtual environment:

$ python -V -V
Python 3.11.0a4 (main, Jan 14 2022, 20:31:59) [GCC 10.2.1 20210110]

$ pip install certifi
Collecting certifi
  Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Installing collected packages: certifi
Successfully installed certifi-2021.10.8

$ pip list
Package    Version
---------- ---------
certifi    2021.10.8
pip        21.3.1
setuptools 60.2.0
wheel      0.37.1

$ python -W 'error' -c 'import certifi; certifi.where()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../lib/python3.11/site-packages/certifi/core.py", line 36, in where
    _CACERT_CTX = get_path("certifi", "cacert.pem")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../python/3.11.0a4/lib/python3.11/importlib/resources/_legacy.py", line 18, in wrapper
    warnings.warn(
    ^^^^^^^^^^^^^^
DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.

Seems like it should be a pretty simple port to the new API. I'd be happy to attempt a PR if it's of interest.

@bskinn
Copy link
Author

bskinn commented Jan 26, 2022

Whoops, didn't check the closed issues first. Sorry!

@bskinn bskinn closed this as completed Jan 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant