ID EN
Shutil

rmtree

Python 3.11

Delete an entire directory tree; path must point to a directory (but not a symbolic link to a directory). If ignore_errors is true, errors resulting from failed removals will be ignored; if false or omitted, such errors are handled by calling a handler specified by onerror or, if that is omitted, they raise an exception.

Syntax

PYTHON
shutil.rmtree(path, ignore_errors=False, onerror=None, *, dir_fd=None)

See Also

paths relative to directory descriptors rmtree() rmtree() rmtree.avoids_symlink_attacks sys.exc_info() auditing event rmtree()