Raghuram Devarakonda added the comment: Index: Lib/shutil.py =================================================================== --- Lib/shutil.py (revision 59581) +++ Lib/shutil.py (working copy) @@ -156,6 +156,16 @@ elif onerror is None: def onerror(*args): raise + + try: + if os.path.islink(path): + if ignore_errors: + return + else: + raise IOError('path can not be symbolic link') + except IOError, err: + onerror(os.path.islink, path, sys.exc_info()) + names = [] try: names = os.listdir(path) -------------------
How does this look? The error handling is slightly different for this case because it can not continue if 'ignore_errors' is True. I will update the doc if the code change is ok. On Dec 20, 2007 12:43 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Guido van Rossum added the comment: > > Thanks for the patch. I think it should raise IOError, not ValueError, > and it should use the onerror() handling used for all other errors. > Also, can you include an update for the docs in the Doc tree? > > > __________________________________ > Tracker <[EMAIL PROTECTED]> > <http://bugs.python.org/issue1669> > __________________________________ > __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1669> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com