Index: Lib/shutil.py =================================================================== --- Lib/shutil.py (revision 59581) +++ Lib/shutil.py (working copy) @@ -140,7 +140,8 @@ raise Error, errors def rmtree(path, ignore_errors=False, onerror=None): - """Recursively delete a directory tree. + """Recursively delete a directory tree. Fail if path is symbolic + link. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, @@ -150,6 +151,10 @@ is false and onerror is None, an exception is raised. """ + + if os.path.islink(path): + raise ValueError('path can not be symbolic link') + if ignore_errors: def onerror(*args): pass

AltStyle によって変換されたページ (->オリジナル) /