Skip to content

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

Closed

Description

@webknjaz

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

Activity

  1. changed the title [-][good first issue][Python 3.11 deprecation] Stop using `importlib.resources.path`[/-] [+][Python 3.11 deprecation] Stop using `importlib.resources.path`[/+] on Jan 12, 2022
  2. sigmavirus24 commented on Jan 12, 2022

    @sigmavirus24
    Member

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

  3. webknjaz commented on Jan 12, 2022

    @webknjaz
    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
  4. locked as resolved and limited conversation to collaborators on Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions