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 is emitted for importlib-resources. #1660

Closed
1 task done
methane opened this issue Feb 2, 2023 · 0 comments · Fixed by #1661
Closed
1 task done

DeprecationWarning is emitted for importlib-resources. #1660

methane opened this issue Feb 2, 2023 · 0 comments · Fixed by #1661
Labels
🐛 bug Something isn't working

Comments

@methane
Copy link
Contributor

methane commented Feb 2, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

$ export PYTHONWARNINGS=default
$ pdm init
$ pdm list

Actual behavior

pdm list shows two warnings.

/Users/inada-n/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/models/specifiers.py:17: DeprecationWarning: open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with open_binary("pdm.models", "python_max_versions.json") as fp:
/Users/inada-n/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/models/in_process/__init__.py:17: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with importlib.resources.path(__name__, name) as script:
╭──────┬─────────┬──────────╮
│ name │ version │ location │
├──────┼─────────┼──────────┤
╰──────┴─────────┴──────────╯

Expected behavior

No deprecation warnings.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
$ pdm info && pdm info --env
/Users/inada-n/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/models/specifiers.py:17: DeprecationWarning: open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with open_binary("pdm.models", "python_max_versions.json") as fp:
PDM version:
  2.4.2
Python Interpreter:
  /Users/inada-n/work/PyMySQL/t/.venv/bin/python (3.11)
Project Root:
  /Users/inada-n/work/PyMySQL/t
Project Packages:
  None
/Users/inada-n/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/models/specifiers.py:17: DeprecationWarning: open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with open_binary("pdm.models", "python_max_versions.json") as fp:
/Users/inada-n/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/models/in_process/__init__.py:17: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with importlib.resources.path(__name__, name) as script:
{
  "implementation_name": "cpython",
  "implementation_version": "3.11.1",
  "os_name": "posix",
  "platform_machine": "arm64",
  "platform_release": "21.6.0",
  "platform_system": "Darwin",
  "platform_version": "Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000",
  "python_full_version": "3.11.1",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "darwin"
}
@methane methane added the 🐛 bug Something isn't working label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant