[issue8523] shutil.rmtree and os.listdir cannot recover on error conditions

Andrew Gorcester report at bugs.python.org
Mon Mar 18 23:09:01 CET 2013


Andrew Gorcester added the comment:

Product of the #pycon 2013 sprint with r.david.murray's assistance.  This implements the list of results as per tarek's suggested 1/ behavior in cases where ignore_errors=True.  Parameters accepted are not changed; return value is changed from None to an empty list in case of no errors or onerror defined by the user, and to a list of tuples exactly like onerror arguments in the case of ignore_errors=True.

As the ignore_errors=True closure-based implementation was adopted from test_shutil.py code, test_shutil.py is changed in one place to take advantage of the new return value in order to add coverage of the new functionality.

----------
keywords: +patch
nosy: +andrewsg
Added file: http://bugs.python.org/file29460/rmtree_ignore_errors_returns_list.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8523>
_______________________________________


More information about the Python-bugs-list mailing list