From 1b2695a4c24a8f44bc68b3f6bcf9f2d62b67dcef Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 24 Aug 2009 17:48:40 +0000 Subject: [PATCH] #6677: note that rmdir only removes empty directories. --- Doc/library/os.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index cab2522d2af..4cc6d4f6629 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1121,7 +1121,10 @@ Files and Directories .. function:: rmdir(path) - Remove the directory *path*. Availability: Unix, Windows. + Remove (delete) the directory *path*. Only works when the directory is + empty, otherwise, :exc:`OSError` is raised. In order to remove whole + directory trees, :func:`shutil.rmtree` can be used. Availability: Unix, + Windows. .. function:: stat(path)