From: Georg Brandl Date: Sat, 17 Dec 2005 17:31:07 +0000 (+0000) Subject: Bug #1343671: clarify docs for os.removedirs X-Git-Tag: v2.4.3c1~183 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03f93a0161994aee1be4bfae0f48c4187b1e4d62;p=thirdparty%2FPython%2Fcpython.git Bug #1343671: clarify docs for os.removedirs --- diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex index a53b5e18a1ee..33124f9218f7 100644 --- a/Doc/lib/libos.tex +++ b/Doc/lib/libos.tex @@ -911,11 +911,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}