Recursively delete a directory tree.
If dir_fd is not None, it should be a file descriptor open to a directory;
path will then be relative to that directory.
dir_fd may not be implemented on your platform.
If it is unavailable, using it will raise a NotImplementedError.
If ignore_errors is set, errors are ignored; otherwise, if onexc or
onerror is set, it is called to handle the error with arguments (func,
path, exc_info) where func is platform and implementation dependent;
path is the argument to that function that caused it to fail; and
the value of exc_info describes the exception. For onexc it is the
exception instance, and for onerror it is a tuple as returned by
sys.exc_info(). If ignore_errors is false and both onexc and
onerror are None, the exception is reraised.
onerror is deprecated and only remains for backwards compatibility.
If both onerror and onexc are set, onerror is ignored and onexc is used.
3.3: Added a symlink attack resistant version that is used automatically if platform supports fd-based functions.
3.8: On Windows, will no longer delete the contents of a directory junction before removing the junction.
3.11: Added the dir_fd parameter.
3.12: Added the onexc parameter, deprecated onerror.
3.13: rmtree() now ignores FileNotFoundError exceptions for all but the top-level path. Exceptions other than OSError and subclasses of OSError are now always propagated to the caller.