]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (#119808)
authorBarney Gale <barney.gale@gmail.com>
Sat, 1 Jun 2024 18:49:12 +0000 (19:49 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Jun 2024 18:49:12 +0000 (19:49 +0100)
commit53b1981fb0cda6c656069e992f172fc6aad7c99c
treeeb035cc156dabbbcd5cd879e3cb4c808716e4288
parent63111bfcf021db29ce6ef9ffa4117ffb7a2cb868
GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (#119808)

Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

`shutil._rmtree_unsafe()` was fixed in a150679f90.
Lib/shutil.py
Lib/test/test_shutil.py
Misc/NEWS.d/next/Library/2024-05-30-21-37-05.gh-issue-89727.D6S9ig.rst [new file with mode: 0644]