Skip to content

Undeprecate the onerror argument in shutil.rmtree() #112645

Closed
@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

A new onexc parameter was added in shutil.rmtree() in 3.12 (see #102828). At the same time passing the onerror argument was deprecated. It creates inconvenience for code that should run on several Python versions. It forces users to modify their working code to avoid deprecation warnings.

I think that there was nothing wrong in onerror. The only advantage of onexc over onerror was that it may require to write less code in some cases, but the deprecation causes an opposite effect -- it requires to write more code.

So I think that the deprecation should be reverted.

@iritkatriel

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions