New submission from rubenlm <ru...@libhertz.com>: The code that lists directory contents in rmtree is:
try: names = os.listdir(path) except os.error, err: onerror(os.listdir, path, sys.exc_info()) If there is an error there is nothing the "onerror" function can do to fix the problem because the variable "names" will not be updated after the problem is solved in "onerror". Two possible solutions: 1 - Call os.listdir() again after onerror() try: names = os.listdir(path) except os.error, err: onerror(os.listdir, path, sys.exc_info()) names = os.listdir(path) 2 - Allow onerror() to return a value and set "names" to that value. try: names = os.listdir(path) except os.error, err: names = onerror(os.listdir, path, sys.exc_info()) ---------- components: Extension Modules messages: 104117 nosy: rubenlm severity: normal status: open title: shutil.rmtree and os.listdir cannot recover on error conditions versions: Python 2.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8523> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com