diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index d802a2572871ea..3fcf1bac5d3d7b 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -316,6 +316,12 @@ Directory and files operations handled by calling a handler specified by *onexc* or *onerror* or, if both are omitted, exceptions are propagated to the caller. + If *path* is a symbolic link to a directory followed by a trailing path + separator, such as ``'link/'``, the operating system resolves the link, so + :func:`!rmtree` deletes the contents of the directory it points to and then + fails to remove *path* itself. :class:`pathlib.Path` strips trailing + separators, so ``rmtree(Path('link/'))`` refuses the link as usual. + This function can support :ref:`paths relative to directory descriptors `.