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

[Python 3.11 deprecation] Stop using importlib.resources.path #183

Closed
webknjaz opened this issue Jan 12, 2022 · 2 comments
Closed

[Python 3.11 deprecation] Stop using importlib.resources.path #183

webknjaz opened this issue Jan 12, 2022 · 2 comments

Comments

@webknjaz
Copy link

I'm observing

E   DeprecationWarning: path is deprecated. Use files() instead. Refer to importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.

This is caused by import requests which in turn calls certs.where(). The deprecation warning is caused by https://github.com/certifi/python-certifi/blob/ff23c47/certifi/core.py#L38 in the certify-land.

Full CI log: https://github.com/cherrypy/cheroot/runs/4783241877?check_suite_focus=true#step:17:535

webknjaz added a commit to webknjaz/cheroot that referenced this issue Jan 12, 2022
webknjaz added a commit to webknjaz/cheroot that referenced this issue Jan 12, 2022
@sigmavirus24 sigmavirus24 changed the title [good first issue][Python 3.11 deprecation] Stop using importlib.resources.path [Python 3.11 deprecation] Stop using importlib.resources.path Jan 12, 2022
@sigmavirus24
Copy link
Member

Duplicate of #170. In the future, please search closed and open issues before creating new ones that are duplicates.

@webknjaz
Copy link
Author

Ah, I missed the closed one.

FWIW, for those coming here from Google, here's what you can do in the pytest configuration when running it with filterwarnings = error under Python 3.11, per the best practices:

filterwarnings =
  error

  # FIXME: drop once certifi fixes their use of `importlib.resources`
  # Ref: https://github.com/certifi/python-certifi/issues/183
  ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 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

2 participants