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.12] DeprecationWarning: shutil.rmtree() - onerror argument is deprecated, use onexc instead #2491

Closed
hrnciar opened this issue Apr 14, 2023 · 1 comment

Comments

@hrnciar
Copy link

hrnciar commented Apr 14, 2023

In Fedora we are building Python packages with the upcoming Python 3.12. Since the 7th alpha click started to fail with DeprecationWarning: onerror argument is deprecated, use onexc instead.

==================================== ERRORS ====================================
____________ ERROR at setup of test_isolated_runner_custom_tempdir _____________
/usr/lib64/python3.12/shutil.py:698: in rmtree
    warnings.warn("onerror argument is deprecated, use onexc instead",
E   DeprecationWarning: onerror argument is deprecated, use onexc instead
_________________ ERROR at setup of test_path_resolve_symlink __________________
/usr/lib64/python3.12/shutil.py:698: in rmtree
    warnings.warn("onerror argument is deprecated, use onexc instead",
E   DeprecationWarning: onerror argument is deprecated, use onexc instead
___________________ ERROR at setup of test_iter_keepopenfile ___________________
/usr/lib64/python3.12/shutil.py:698: in rmtree
    warnings.warn("onerror argument is deprecated, use onexc instead",
E   DeprecationWarning: onerror argument is deprecated, use onexc instead
_____________________ ERROR at setup of test_iter_lazyfile _____________________
/usr/lib64/python3.12/shutil.py:698: in rmtree
    warnings.warn("onerror argument is deprecated, use onexc instead",
E   DeprecationWarning: onerror argument is deprecated, use onexc instead
=========================== short test summary info ============================
ERROR tests/test_testing.py::test_isolated_runner_custom_tempdir - Deprecatio...
ERROR tests/test_types.py::test_path_resolve_symlink - DeprecationWarning: on...
ERROR tests/test_utils.py::test_iter_keepopenfile - DeprecationWarning: onerr...
ERROR tests/test_utils.py::test_iter_lazyfile - DeprecationWarning: onerror a...
============= 572 passed, 21 skipped, 1 xfailed, 4 errors in 1.36s =============

shutil.rmtree() now accepts a new argument onexc which is an error handler like onerror but which expects an exception instance rather than a (typ, val, tb) triplet. onerror is deprecated and will be removed in Python 3.14. (Contributed by Irit Katriel in gh-102828.)

Environment:

  • Python version: 3.12.0a7
  • Click version: 8.13
@davidism
Copy link
Member

It's being fixed in pytest.

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