diff options
author | Georg Brandl <georg@python.org> | 2005-12-17 17:31:03 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-12-17 17:31:03 (GMT) |
commit | 69cb3cde1a8b033ab01fd7748929d0e2141d5a3e (patch) | |
tree | 8cdb77d99d9a27f43fb4eb740693ec6b79faca9f | |
parent | c1d2f7b6ad3fbd456f3b3a09a493e14f8880bc6c (diff) | |
download | cpython-69cb3cde1a8b033ab01fd7748929d0e2141d5a3e.zip cpython-69cb3cde1a8b033ab01fd7748929d0e2141d5a3e.tar.gz cpython-69cb3cde1a8b033ab01fd7748929d0e2141d5a3e.tar.bz2 |
Bug #1343671: clarify docs for os.removedirs
-rw-r--r-- | Doc/lib/libos.tex | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex index 04acce6..48cda9b 100644 --- a/Doc/lib/libos.tex +++ b/Doc/lib/libos.tex @@ -931,11 +931,15 @@ Availability: Macintosh, \UNIX, Windows. \index{directory!deleting} Removes directories recursively. Works like \function{rmdir()} except that, if the leaf directory is -successfully removed, directories corresponding to rightmost path -segments will be pruned way until either the whole path is consumed or -an error is raised (which is ignored, because it generally means that -a parent directory is not empty). Throws an \exception{error} -exception if the leaf directory could not be successfully removed. +successfully removed, \function{removedirs()} +tries to successively remove every parent directory mentioned in +\var{path} until an error is raised (which is ignored, because +it generally means that a parent directory is not empty). +For example, \samp{os.removedirs('foo/bar/baz')} will first remove +the directory \samp{'foo/bar/baz'}, and then remove \samp{'foo/bar'} +and \samp{'foo'} if they are empty. +Raises \exception{OSError} if the leaf directory could not be +successfully removed. \versionadded{1.5.2} \end{funcdesc} |