[Python-checkins] commit of r41734 - python/trunk/Doc/lib/libos.tex

reinhold.birkenfeld python-checkins at python.org
Sat Dec 17 18:31:06 CET 2005


Author: reinhold.birkenfeld
Date: Sat Dec 17 18:31:03 2005
New Revision: 41734

Modified:
   python/trunk/Doc/lib/libos.tex
Log:
Bug #1343671: clarify docs for os.removedirs



Modified: python/trunk/Doc/lib/libos.tex
==============================================================================
--- python/trunk/Doc/lib/libos.tex	(original)
+++ python/trunk/Doc/lib/libos.tex	Sat Dec 17 18:31:03 2005
@@ -931,11 +931,15 @@
 \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}
 


More information about the Python-checkins mailing list