]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (#119634)
authorBarney Gale <barney.gale@gmail.com>
Wed, 29 May 2024 20:11:30 +0000 (21:11 +0100)
committerGitHub <noreply@github.com>
Wed, 29 May 2024 20:11:30 +0000 (20:11 +0000)
commita150679f90c6e3f017bd75cac3b8f727063cc4aa
tree17d152ca472436d050151412711e0981dd2a6c05
parentc22323cd1c200ca1b22c47af95f67c4b2d661fe7
GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (#119634)

Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented
without recursion.

`shutil._rmtree_safe_fd()` is not affected and can still raise a recursion
error.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Lib/os.py
Lib/shutil.py
Lib/test/test_shutil.py
Misc/NEWS.d/next/Library/2024-05-29-20-42-17.gh-issue-89727.5lPTTW.rst [new file with mode: 0644]