[issue39246] shutil.rmtree is inefficient because of using os.scandir instead of os.walk

Felipe A. Hernandez report at bugs.python.org
Tue Jan 7 09:36:26 EST 2020


New submission from Felipe A. Hernandez <ergoithz at gmail.com>:

os.rmtree has fd-based symlink replacement protection when iterating with scandir (after bpo-28564).

This logic could be greatly simplified simply by os.fwalk in supported platforms, which already implements a similar (maybe safer) protection.

----------
components: Library (Lib)
messages: 359512
nosy: Felipe A. Hernandez
priority: normal
severity: normal
status: open
title: shutil.rmtree is inefficient because of using os.scandir instead of os.walk
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39246>
_______________________________________


More information about the Python-bugs-list mailing list